A 'population-thinning' gene doesn't exist in evolution. Organisms do not hold onto dormant traits until they need them for later. That's an extremely common misconception about how natural selection works. 99.9% of human evolution has been spent in a desperate fight against extinction.
Organisms will occasionally exhibit behaviors that are altruistic, but it's based on the principle of reciprocation, or because the organisms they're helping are in-fact their offspring or relatives carrying their DNA. This is governed by a principle called Hamilton's Rule.
https://en.wikipedia.org/wiki/Inclusive_fitness#Hamilton's_ruleUnless being gay is somehow aiding the reproductive abilities of people who share the gay person's genes, then evolution didn't select for it. Doesn't mean it's not genetic or biological in origin - de novo mutations exist and lots of stuff is epigenetic or potentially an environmental effect in the womb. But I don't buy the evolutionary argument for homoloveuality being a 'population control mechanism' even slightly.