Our current concepts of sexuality are much more culturally determined than we think they are. The idea of heterosexual vs. homosexual isn't really one that plays out in apes in general or in humans historically.
Take the Greek cultures, for instance. It's often said Alexander the Great was gay by some people, while others vehemently deny it, insisting he must have been heterosexual. However, if you were to ask Alexander which he was, he would probably look at you like you had just suffered a massive head wound, because the ancient Greeks did not think of sexuality in those terms. For him it was a matter of status. What sex of lover he chose was largely irrelevant. What social status they occupied compared to him was very relevant, especially when it came to what role he would take in the sexual encounter.
The same is true in general of the relationships derided these days as being pedophilic in ancient Greece and Rome. That there was sex involved in the relationship was incidental. That the two parties were of the same sex was incidental. In fact, had either factor been important to either party, it would have been considered scandalous. The point of the relationship was one of fosterage, of men fulfilling their duty to introduce younger males into adult society. Men didn't look for the cutest youth they could find. They looked for the highest status youth (at or below their own social status, it would not be permitted to take on a youth above one's social status because it would be detrimental to the youth's positioning in adult society) with the greatest amount of talent they could foster. Youths in turn hoped to attract well-established males who could provide them the greatest social connections.
Sex was simply a means to an end for establishing broader social relationships in those societies, and that point of view was hardly restricted to same-sex relationships.
Look at the long history of fathers marrying off their daughters or sons to families of wealth or status, or to establish an alliance with a family of similar social standing. That practice has, until very recently, been the rule rather than the exception in European society, Middle Eastern society, Semitic societies, Asian societies, Indian society... you name it. The human race has largely seen the act of sex itself as a means to an end to achieve more important social goals since time began.