The case with gay genes is different. Regardless of any other trait, I'm genetically prone to not have any offspring. Thus, eventually my genes would be less and less common.
All that's required for a trait to persist is that it benefits the pool.
If the pool benefits from have 1% of members being blind, then so they shall be.
We don't have to understand the benefit for it to exist either.
From Wikipedia, quoting evolutionary biologist Jerry Coyne: "Group selection isn't widely accepted by evolutionists for several reasons."
Or that it's less bad than whatever beneficial trait it's coupled to.
Humans consume a lot of water in order to shed heat. Our backs are pretty f-d up. Our brains waste a lot of energy and require a very long childhood. But on the flip side we're basically terminator compared to the African fauna our primitive ancestors hunted.
It seems reasonable that being gay does significantly reduce your ability to have children; therefore it is reasonable to expect that if it was an inheritable trait it would have been selected against.
We have understood how this is not true for decades or even hundreds of years, and it's not even some impossible concept to grasp.
All that's required for a trait to persist, is for it to benefit the pool, not the individual.
The only way the seemingly obvious but incorrect idea you descibed applies is, a trait which is good for the group at the expense of the individual, if it's 100% effective like sterility unlike say alarm-calling which merely carries a risk for the individual, is that such a trait can never grow to where all members exhibit it.
But it can absolutely be strongly selected for maintaining whatever the optimal percentage is. IE, if it benefits the pool for 10% of members to be sterile, then the percentage of sterile members will not decrease through the mechanism you and so many imagine, but will stay at 10% for as long as the benefit exists.
This is a well debunked belief. Genes are selfish, and they only reproduce to the benefit of the gene.
Group selection does not occur.
An example is evolutionary stable strategies, where cheaters persist in the population, even though the pool would be better off if all individuals in a pool were selfishly altruistic towards pool members.
"If there was a genetic cause for shortsightedness, why is it still around?"
"If there was such a thing as a genetic disease, why haven't they evolved out?"
"If not having X-ray vision was genetic, wouldn't the absence of X-ray vision have been selected out?"
You really can't expect evolution to accomplish its "goals," per se. It is sort of a gentle flow down a lazy river, towards adaptation.