I read an article in Scientific American Mind about homosexual behavior in animals. Turns out over 1500 species have been observed doing it. Scientists have theories of why this is. The article states "Researchers are now revealing, for example, that animals may engage in same-sex couplings to diffuse social tensions, to better protect their young or to maintain fecundity when opposite-sex partners are unavailable--or simply because it is fun." I'm afraid I must quibble with this last bit, because it's mixing levels of explanation.
I'm sure animals almost always engage in sexual activity because it's fun. Now, the reason there is a sex drive at all is because of, in part at least, pregnancy. But that does not mean that an individual animal engages in sex because he or she wants a pregnancy. This is especially true for non-human animals.
The reason an organism does something and the reason that organism has the drive to do something are different questions with different kinds of answers. For example, I eat because I am hungry, or because I want to taste the food I'm eating. The reason I have hunger is so that I eat, so I will get the nutrients I need to live.
The genes are a blueprint for a being with drives. The drives are there because they propagate the genes. That is their teleological function. But the day-by-day decisions of beings are for goals and reasons that have to do with their drives, personal history, and immediate environment.
The difference is crucial, and there are several excellent books that explore the ramifications: Dawkins (1979), and Stanovich (2004).
Dawkins, R. (1976). The Selfish Gene. Oxford University Press.
Driscoll, E. V. (2008). Bisexual species. Scientific American Mind. June/July 68--73.
Stanovich, K. (2004). The Robot’s Rebellion: Finding Meaning in the Age of Darwin. University of Chicago Press.