It's probably simplistic to think about evolution as entirely about breeding - it isn't. In a deer herd only the alpha male will breed; so what about all the genes from all the other males?
Well, they try their luck, but not all will succeed - the ones that don't succeed are, thus, no different from a gay but one assumes that they make their contribution to the welfare of the herd as a whole.
What of the lesbian animal? Well, there's not much difference between won't breed and can't breed - of course there is always the case where the alpha male rapes the lesbian and here the rules are much like the Bible - the alpha male gets her as a wife and protects her against other competitors.
Assuming a female does not breed, she too will make a contribution to society.
Often animals, usually males, will be ejected from the herd and have to establish their own harem/find a partner. If they fail then the species as a whole has lost nothing, the next generation will have that much more space and food.
Evolution is not a process that goes out looking for opportunities, mutations arise and, depending on circumstances, some are found to be advantageous. As time progresses and the environment changes the advantageous mutations may become a disadvantage - take the Dodo. It was well evolved to be able to eat the seeds of the Coco de Mer tree - it was also slow, and flightless and delicious. These last three did not matter and were an advantage until something changed.
Evolution is random. Evolution is not a moral agent. Evolution has no purpose or goal.