Homosexuality is a genetic defect or in some cases just perversion. If you are attracted to the same sex you cannot produce an offspring. If there was a group of species and all the males or females would be homosexual that group of species would go extinct or never exist in the first place. Naturally the organism will do anything to keep it self alive. And to do that it needs to reproduce.