Unfortunately, this can't be a real serious scientific discussion. For that, you would have to go to studies published by real geneticists and evolutionary biologists. But I'll try to summarize my understanding of it.
First of all, a little background. Homo sapiens has a K-type reproductive strategy, (wikipedia article). This can be summarized as "put all your eggs in one basket, and watch that basket very carefully." Each human female bears only a relative few offspring in a lifetime, and we want nearly all of our offspring to reach adulthood. Contrast this with, r-type reproductive strategies, e.g., insects, frogs or small rodents. An r-strategy can be summarized as "make lots of eggs, and scatter them as widely as possible. (And don't sweat the small stuff.)"
Now, basic evolutionary theory says that any trait that reduces your ability to reproduce should, over the millenia, disappear from the gene pool, or at least become a rare recessive. In terms of evolution, I am a 100% failure: I survived to adulthood, I'm heterosexual and married, but I have no children. Neither does my sister. So my parents' contribution to the gene pool is lost. (I have numerous cousins, however, on both sides of the family.)
The same would apply to an exclusive sexual desire for the same sex. In the last 300 years we have had reliable artificial insemination, but some myths suggest crude solutions dating back to pre-roman eras. Still, if you never (or rarely) have sex with someone of the opposite sex, you are less likely to have children, and the genes you are carrying will be less likely to show up in the next generation.
It's true that exclusive homosexual orientation does not prevent having offspring, even before modern technology. A man might get married for social reasons, have sex with his wife a few times (possibly while imagining another man in bed with him) in order to have children and/or keep up appearances. But a man who was completely uninterested in females might suffer from impotence and/or premature ejaculation. Both of these make it less likely that he would have children. And his wife was unlikely to complain, because he was also her main source of support.
Similarly in pre-modern times a woman might have gotten married and had sex with her husband, and had children, even if she was completely turned off by males. In many societies, a man was allowed to have sex with his wife whenever he wanted, whether she wanted to or not. But a woman who doesn't enjoy sex is likely to get out of bed immediately afterward and do something else (which reduces the chance of conception).
I also note that in some societies the marriages were arranged by the parents, and the adolescents being married off had little or no say in the matter. Some variation of this practice persisted at least into the 1950s; it was considered normal among the upper class (those with inherited wealth). If the couple didn't find each other attractive, they would be married, possibly produce some children to make their parents happy, but look elsewhere for sexual pleasure.
Nonetheless, anybody who has ever been married or even shacked up will understand the concept of "shalom ha-bayit": peace in the house. A man may be allowed to force himself on his wife, but an unhappy wife does not lead to delicious meals, a clean and neat house, and other things that the man might like to have. Not to mention that women were often found in the kitchen holding a heavy pot or skillet, or a rolling pin. So men usually learn to make some accommodation with their wife, in sexual and other matters.
So... exclusive homosexuality is a significant disadvantage in terms of passing on your genes. Even being bisexual creates some disadvantage. That being the case, why haven't the genes for homosexual orientation disappeared from our genome?
There are several possibilities. Two that I like:
1. The "maiden aunt" hypothesis: Let's say that an ancient tribe faced a problem(*) that could wipe out the whole tribe, but happened rarely, about once in 100 or even 200 years. Often, no living member of the tribe would remember the last time it happened, and -- in particular -- what the tribe did to get through it. Remember, this is before the invention of writing. Some history gets transmitted orally, but details can get lost over the generations. Men can live to be 80 or so, even in primitive societies, but women are likely to die before menopause, worn out by frequent children. Also remember that in many primitive groups, the men and women have separate councils, oral traditions, etc.
(*) E.g., locusts, extreme drought, tsunami.
So it's useful having a few 80-year-old women around. They can transmit their memories of "how we coped with X disaster" to the younger women, who will pass it down etc. And the simplest way to have 80yo women is to have women who never have children; in a primitive society that means they don't have sex with men. So, the "homosexual" gene may have been the "maiden aunt" gene (which would manifest in men as exclusive interest in men).
2. Recent studies have shown that there is no single "gay gene". That is, there is no single allele (gene-variant) which always causes homosexuality. Current genetic theory suggests that several different gene-sites are involved, and that exclusive same-sex interest occurs only when multiple sites contain the less-common allele.
What if each of those genes, separately, were beneficial? At least one study suggests that one of the genes involved also causes increased fertility in heterosexuals. Or perhaps some of the genes are beneficial when paired with the more common counterpart, but genetically disadvantageous when homozygous. A gene like that is likely to be preserved: if only one parent carries the gene, you will have an advantage. Even if both parents are carriers, you have only a 25% chance of being disadvantaged, but a 50% chance of gaining an advantage.
One easy example of this type of thing is sickle-cell anemia. This is a genetic disease which produces misshapen red blood cells that clog up capillaries. If you are homozygous for this gene, you have the disease. Even moderate exertion will be painful or crippling, and your chance of surviving to raise children is very low without modern medicine. But, if you are heterozygous, you have nearly normal red blood cells. The cells will "sickle" if you go up to high altitudes, or if you become dehydrated, but most of the time they cause no trouble. But let's say that you become infected with the Malaria plasmodium. When the plasmodium infects a red blood cell, the cell "sickles" and is destroyed by the bodies normal mechanism for clearing out dead or useless cells. As a result, the plasmodium does not reproduce.
So, sickle-cell disease is an advantage in areas where Malaria is common -- primarily tropical and sub-tropical areas. And, in fact Sickle-cell Disease is most common in people from semi-tropical Africa and areas around the Mediterranean sea.
Bottom line: it is likely that homosexuality is caused by some combination of genes that are individually advantageous, or that are advantageous when heterozygous but not when homozygous.