The "gay gene" theory has had its ups and downs, scientifically speaking. Some of the early research was shown to be severely flawed, but other subsequent research suggests there may be a genetic component... which is probably technically true regardless, given that genes have an impact on almost everything.
One of the more interesting areas of research is in the impact of epigenetics on homosexuality. Dr James O'Keefe did an interesting TED talk summarizing one theory that's gaining some credibility. Epigenetics basically states that similar genes can express themselves in different ways based on external circumstances. For example, epigenetic studies of ants have shown that if the colony is hungry, the queen will give birth to more worker ants, but if the colony is under attack, she’ll give birth to more warrior ants. In both cases, ants’ genetic makeup are exactly the same, the only difference is how they get expressed. Warrior ants will be bigger and more aggressive whereas worker ants will be smaller and better at finding food. O'Keefe points to two studies that suggest that if a mother gives birth to a high number of male offspring or experiences severe prenatal stress, the likelihood of her giving birth to a gay son increases, possibly due to epigenetic switches that are triggered by the stress. The theory would suggest homosexuality is nature’s way of ensuring that the family won’t have an unmanageable number of mouths to feed or a son who might fight with his brothers over female mates, two problems that can reduce a family’s overall health and cohesion. Put another way, gay kids help reduce resource competition among family members. When taken with the "Guncle" theory -- which suggests that homosexuality helps create "helpers" to care for the physical and emotional well-being of the family unit -- it could make sense that the stresses that require "guncles" could trigger the epigenetic changes.
It's a fascinating idea.