General Discussion
In reply to the discussion: Where Masturbation and Homosexuality Do Not Exist [View all]AFAIR only male homosexuality has been traced down to a genetic mechanism so far.
The root is a gene of the mother that increases her fertility/attractiveness. (So, if you absolutely don't want a gay child, get an ugly wife.) The gene has the side-effect that about 10% of her male offspring turns out homosexual. From an evolutionary point of view, the usefulness of the increased fertility obviously outweighs the sacrifice that some of those sons are less likely to have kids themselves.
Of course it's reasonable to assume a similar genetic side-effect being responsible for female homosexuality and bi-sexuality (and transgender), but I don't remember hearing or reading about anything conclusive.
Behold the mighty google:
http://www.slate.com/articles/health_and_science/human_nature/2008/06/sexual_antagonism.html
http://www.cs.cmu.edu/afs/cs.cmu.edu/user/scotts/bulgarians/nature-nurture/lesbian.html