Specifically, there are gay men who are repulsed by the prospect of sex with women, and then gay men who are simply not interested (or not as interested) in sex with women.*
Is that really in need of an explanation, though? Some people are repulsed (by stuff), and others aren't. That is to say that whatever causes homosexuality probably doesn't also necessarily cause disgust for heterosexual activity.
But in societies where polygamy is the norm and men compete for women, it seems likely to me that any man who is less interested in winning is less likely to win, and the costs of sexual interest in men might grow significantly.
Homosexuality could serve in such an instance to reduce competition, though. If you take animals such as lions, the males are extraordinarily competitive, to the point where they will kill children of other lions and drive away all competing males. Humans can't sustain that kind of competition, though. Humans are vulnerable for longer when we are children and require more investment to mature than most other mammals, so if competition is too fierce and leads to infanticide, the species can't sustain itself. In addition, humans are geared for cooperation with other humans, since we're naturally social creatures and capable of learning and imitation from others.
So I think humans don't really have much to gain from competition and more to gain from cooperation. And considering that, it might be the case that the "gay uncle" really does help the reproductive fitness of the group, or at least, doesn't hurt it so much that genes that create the potential for homosexuality are selected against.
Not every individual in a species has to be geared for reproduction, particularly if the species is very social and organizes itself into groups. In bees, for example, the vast majority of bees are totally infertile with just a handful of fertile bees in a single hive. It doesn't matter that the bees individually have terrible reproductive fitness, because the hive as a whole has very high reproductive fitness.
In farming societies where monogamy is the norm and marriages are economic arrangements, it seems to me that the reproductive cost of sexual interest in men is minor (or possibly positive, if men in power are willing to trade resources for sexual favors).
Monogamy isn't necessary; it works with polyandry and other arrangements such as levirate marriage too.
Is that really in need of an explanation, though? Some people are repulsed (by stuff), and others aren't.
It seems to me that any mental feature that can be explained should be explained. It makes great sense to me why there are people who feel visceral disgust at the prospect of sexual activity with their siblings, and that there are men who feel visceral disgust at the prospect of sexual activity with men. (Interestingly enough, this sort of 'homophobia' seems more heritable than homosexuality is, which makes sense--this is actually selectively positi...
Epistemic status: speculating about things I'm not familiar with; hoping to be educated in the comments. This post is a question, not an answer.
ETA: this comment thread seems to be leading towards the best answer so far.
There's a question I've seen many times, most recently in Scott Alexander's recent links thread. This latest variant goes like this:
Obligate male homosexuality greatly harms reproductive fitness. And so, the argument goes, there must be some other selection pressure, one great enough to overcome the drastic effect of not having any children. The comments on that post list several other proposed answers, all of them suggesting a tradeoff vs. a benefit elsewhere: for instance, that it pays to have some proportion of gay men who invest their resources in their nieces and nephews instead of their own children.
But how do we know if this is a valid question - if the situation really needs to be explained at all?
For obvious political and social reasons, it's hard to be sure how many people are homosexual. Note that we are interested only in obligate homosexuality - bisexuals presumably don't have strongly reduced fitness. The Wikipedia article doesn't really distinguish obligate homosexuality from bi-, pan- and even trans-sexuals. The discussion in the SSC comments used an (unsourced?) range of 1%-3%, which seems at least consistent with other sources, so let's run with that.
The rate of major birth defects in the US, as reported by the CDC, is also about 3%. This counts both developmental and genetic problems, and includes everything from anencephaly (invariably fatal) through Down syndrome (severe but survivable) to cleft palates (minor). But most of these, at least 1.5% of births, were always fatal before modern medicine, and many of the others reduced fitness (via mate selection, if nothing else). Various other defects and diseases, which only manifest later in life, are also thought to be influenced or determined during early development. And so is sexual preference.
(Whether homosexuality is a developmental disorder is not the point; I'm comparing the effect of selection pressure on fatal teratology with its effect on reduced-fitness homosexuality.)
Embryological development is a complex and fragile process, and there are many ways for it to go wrong. We don't wonder how it is possible that selection pressure allows anencephaly to occur in 1 in 4859 births. There are certainly direct causes of anencephaly, explanations of why it happens when it does, but (I think) we don't a priori expect them to be due to tradeoffs yielding benefits elsewhere. It's just as plausible that the tradeoffs involved are against even worse (counterfactual) problems elsewhere - or that there are just no available mutations that don't have these or equally severe problems.
Could it be that linking sexual preference to the biological gender is, for some complex developmental reason, fragile enough that it goes wrong despite all selection pressure to the contrary, that it has no redeeming qualities from the viewpoint of evolution, and that is all there is to it?
When faced with any phenotype with reduced fitness, how can we judge if there is something to be explained - a beneficial tradeoff elsewhere to search for - or merely a hard problem evolution couldn't solve completely? And is there a way to quantify this question, relating it to the known mathematical models of genetics?
Notes:
1. I'm posting this in the spirit of recent suggestions to post more and accept lower quality of (our own) posts to Discussion.
2. I'm going to sleep now and will start replying to comments about 10 hours from now; sorry for the inconvenience.