Salon interviewed Simon LeVay, former neuroscientist and author of Gay, Straight, and the Reason Why: The Science of Sexual Orientation. The question I pose above is a dumb one for anyone with even a small grasp of evolution and genetics, but it's such a common one it's worth hearing LeVay's answer:
The usual idea is that a gene predisposing some individuals to homosexuality might promote the reproductive success of others, and the two effects might balance out. It might be that a gene predisposing a man to be gay might make a woman even more attracted to men than she otherwise would be, so that she would engage in more heterosexual sex and thus become pregnant more often. There are a couple of studies reporting that women who have gay male relatives (and who may therefore carry the same "gay gene") do indeed have more children than women without any gay male relatives. The answer will remain speculative, however, until the actual genes have been identified and their mode of action worked out.
There is also a socially evolutionary argument, that societies that had a few men uninterested in actually reproducing with women themselves might be advantageous. They might help advance a society's education, or become spiritual leaders, or be warriors unaffected by the need to take care of a household. One day, we'll get closer to the truth. It still amazes me that we are at such an early stage of figuring out this fascinating scientific question.