There are a few mechanisms as to why homosexuality is so important, and why it has evolved in so many thousands of species.
1) Sexually antagonistic selection. A trait may boost reproductive fitness in the females of a species. But both males and females get almost the entire genome, so males receive the trait too. If the trait boosts fitness in females, but causes males to be homosexual, and the net fitness gain is positive, the trait will be selected for and homosexuality will evolve.
2) Inclusive fitness. In a large family, it may be useful to have a few gay men or women who do not have children of their own. Instead of reproducing, they can use their resources to help their siblings reproduce by feeding and defending their offspring. Their genes are indirectly passed on because they share much (50%) of their genome with their siblings, who do reproduce. This is the same principle that allows ant colonies to work. However, it's not clear that this mechanism is still in effect, or whether it necessarily ever has been in humans. More evidence needed.
3) Social bonding. Bisexual behavior allows intrasexual social sexual activity. American Bison and Bighorn sheep have social systems in which male-male mating accounts for nearly half of all sexual activity. Female bonobos, about the same. Homosexuality occurs in thousands of other species as well, to varying degrees.
4) My favorite: the Johnny Depp hypothesis. Basically, there are a lot of genes that make you attractive to members of the opposite sex. Get a bunch of these genes, and you're in luck, because they make you 'more feminine' which is attractive to women. Get too many, and you become gay. The notion is that there's a whole bunch of genes which push you closer and closer to the gay tipping point, but also increase your fitness. Sometimes you only get a few, sometimes you get the right balance, sometimes you get a whole load of them and end up homosexual. In this way, all these genes evolve in the population and become more frequent, but as a side effect, homosexuality also sticks around.