Gays may function as backup child care providers and "babysitters" in a hunting-gathering species with a high mortality rate.
That's a theory that has gained ground.
Consider wolf packs. Only the alpha male and female can breed. All the others in the pack nurse and rear the pups, leaving the alpha pair free to breed.