As Muslims, our attitude towards homosexuals is that they are our fellow human beings, albeit in a state of rebellion against their fitra, which is the primordial state of submission to Allah that was given to every human being from the beginning of the creation of man. Guarding one's sexuality from unlawful sexual intercourse is the duty of every Muslim. If it is unlawful for a man and woman to have sexual intercourse outside of marriage, then it is even more egregious for a man to approach another man, or a woman to approach another woman.
The purpose of life is to surrender ourselves to Allah. Our desires must be in accordance with Sacred Law. We do not fashion law to follow our desires. Therefore, issues such as gay marriage, are completely antithetical to both the letter and the spirit of Sacred Law, which defines marriage as being between one and one woman. The only exception to this provision is the allowance for a man to marry up to four women, with the condition that he be able to treat them all equally. As far as associating with homosexuals is concerned: As Muslims living in Western societies, we recognize that there is a need to interact with many different people. With the example of the Prophet, Allah bless him and give him peace, before us, we know that we are required to deal with people with justice, compassion, and dignity. We avoid insulting or abusing homosexuals. And we also exercise caution about who we take as close friends. The basis for close friendships in Islam is the existence of God-fearingness and righteousness. Thus, a Muslim is courteous in his dealings with non-Muslims, but also realizes that close companionships are reserved for those who are upright in their beliefs and character.