I remember being told in college that if you put too many rats in a confined space natures answer was to make some turn homosexual to sort of naturally lower the overpopulation.
There are often bisexual behaviors among the lower animals, usually as a result of an imbalance in the social environment.
Konrad Lorenz - often referred to as the ‘father of ethology’ - is an interesting read on this issue.
when female dogs get spaded they become confused and want to hump anything, did you ever notice that?