I do not know what causes some to prefer the same sex and others to prefer the opposite. However, there are obviously specimens of each, as well as some who are not quite so particular about their choice.

I believe, but may be wrong, that many who do prefer a particular sex would be able to void their preference in given circumstances, from having their life count on it via it giving elevated status to giving immediate gain such as money. The level necessary for this will vary between individuals of course (some probably simply won't do so, for any reason at all), and I also think the general views of their culture will affect the level, as said in my previous post.