I never thought of that angle, but it actually makes a lot of sense tbh. It'd be interesting to see if gay pedophilia is much more pronounced in sex-segregated cultures. I think Zephyrus could chime in with some relevant facts regarding the separate roles of wives and catamites in ancient Rome and Greece here.
You rang?
I may have said this here before, but in the ancient world there was no such thing as sexual identity or orientation, only sexual practices. Men and women were expected to marry and produce children as a matter of principle to sustain the population (especially in a pre-industrial age when a high birth-rate was necessary to balance out high infant mortality).
Aside from sex within marriage, men (but not women because fuck yeah patriarchy) were free to engage sexually without fear of legal ramifications (unless they prostituted themselves). This included not only taking mistresses or screwing whores, but also taking male lovers, and among the upper classes in Greece, this included teenage boys.
Let me clarify that pederasty (the term scholars use instead of pedophilia) was between an older man and someone who was just at or not too long after puberty, i.e. they were consensual relationships with a young adult who had reached the age of reason. These relationships were conceived of as not only physical, but as the means to prepare a young man for political life and social advancement by following the lead of an older, more established man. Paying for this education by sexually gratifying that older man was thought to be acceptable.
That said, there were limits. It was acceptable that the older man be the active, and the younger the passive partner. But men who grew up and persisted in being the passive partner were considered effeminate and morally corrupt.
As for the Romans, these practices existed, but were much less accepted culturally.