My 2 cents too:

Genes that seem to "code for their own extinction" (as Saige puts it above) are not always selected against by natural selection. This happens when the gene also carries some hidden, not-so-obvious benefit with it.

Does everyone here know something about Mendelian genetics? Say there was a theoretical "gay gene" (I doubt a definite one exists as I agree with bonobo above) and it was a recessive gene. Say that it causes someone to become gay when he inherits two recessive copies of it, one from each parent and that it does not appear to cause any changes when there is only one copy of it.

A "gay gene" like this could theoretically be passed on from generation to generation and not be selected strongly against IF it also had a hidden benefit such as, say, confering some protection from some prevalent disease on the carrier of the gene who was heterozygous for this gene.

It is conceivable that something like this could exist, just as the gene for sickle cell anaemia got passed along generations of Africans -- heterozygous carriers of the sickle cell gene were conferred protection from malaria.