Bees are obviously a very extreme example of this but I think they’re an apt one. The important point is that fertility is not selected for in bees, but instead, the activity of raising infertile workers.
The incorrect assumption about homosexuality is that a person is homosexual because of their genes. It’s more likely that homosexuality is caused by the genes of the parent. After all while an individual is only concerned with his own reproductive fitness to the exclusion of his siblings, the parent is equally concerned with the reproductive fitness of all their children. It’s true that homosexuality cannot be selected for, but a propensity to have homosexual children CAN be selected for if it increases the reproductive fitness of older siblings.
Traditional behavior is so widely varied, though, that it’s difficult to draw any conclusions. Some traditional societies practiced polyandry, others, polygamy, and still others, levirate marriage, and avunculism, and so forth. Some traditional societies were accepting of homosexuality and even transgenderism. You say that cultures that prohibit childbirth die out, but many diverse cultures have a thriving tradition of monasticism (which is even worse for reproductive fitness than homosexuality!)
Would they? “Gay” is a recent category; traditional societies did not attempt to classify humans in that way and it only became popular when religious authorities attempted to criminalize it and early psychologists attempted to medicalize it. Men were not “gay” or “homosexual”, they were more or less inclined towards other men.