I'm not certain whether it's been conclusively proven that homosexuality is genetic. However, it would seem reasonable to think there is a genetic tendency for homosexuality, as a percentage of all human populations is homosexual, despite cultural differences.
It is also fairly easy to theorize how homosexuality
could be hereditary, though it takes some knowledge of
game theory.
Basically, evolution doesn't always favour only those attributes that promote the survival of the individual, but also those that promote the survival of the entire community. This is called kin selection
WP. It is known that animals exhibit
altruism, behaviors which don't necessarily result in passing on of genes, but improve the overall fitness of the group. The idea is fairly simple; from an evolutionary point of view, your brother or even your second cousin surviving means many of your genes will pass on, so behaviours that promote their survival are often favoured by natural selection.
So how does this relate to homosexuality? Well, basically, humans are extremely social animals. It is our capability for forming large and complicated societies that has allowed us to become the dominant mammal on the planet. But as I'm sure you've noticed, it takes a lot of work to maintain social relationships. Every day, we smile at each, exchange pleasantries, look each other in the eye.. a lot of things that aren't strictly necessary for survival, but help hold the society together. Many of these behaviours are universal to humans all over the world, and most higher mammals exhibit social behaviour as well. Homosexuality could also be interpreted as a form of social behaviour, and as a matter of fact a close relative of ours, the bonobo, actually
exhibits homosexual behaviour. It serves several social functions, such as conflict resolution and reconcilitation.
Obviously the social function of homosexuality in humans would be more complex than that; we don't see men sixty-nining it out after a disagreement over a referee decision (at least not in the bars I frequent

). But there have been many instances of homosexuality
throughout history, and quite often it's practiced by men and women who also engage in heterosexual relationships.
So, to sum it up, it's possible that homosexuality serves a social function that improves the overall fitness of the human race. To
prove it does would be extremely difficult, but it's certainly a possible construct, and in my opinion does a good job of predicting the actual prevalence of homosexuality.