I think, particularly in the past, that a lot of gay Catholic men were drawn to the priesthood because they viewed it as a way to conquer their desires. "Surely, if I become a priest and dedicate my life to God... and surround myself with other clergy, I will stop having these sinful feelings!"
and of course, the fact that the priesthood weren't allowed to marry made it far more likely to appeal to homosexual men because, whether they understood why or not, they already had an aversion to getting married to a woman.
So in a time of great ignorance about the biological basis for homosexuality, when people were made to feel sinful and horrible for feelings they had no control over... the church set themselves up for a massive influx of gay priests.
Now, unless a human being is asexual or of very low sexual drive (and these people do exist, though probably not in the quantities required to fill the priesthood exclusively with them, and I think they are better used in the sciences anyway) - it is simply not practical to expect them to ignore their sexual desires for life.
So, these bottled up desires end up breaking free at some point, and often with disastrous consequences that could have been avoided had a healthy, scientifically-informed, realistic attitude about sexuality been present in the first place. If these people hadn't been made to feel vile and sinful in the first place.
As for how this connects with pedophilia? I honestly have on idea. I do not know to what degree pedophilia is an inborn sexual preference. I really don't. Perhaps there are born pedophiles, and then pedophiles who are created by circumstance? In the exact same way some heterosexual men end up participating (perhaps unwillingly at first) in homosexual activities in prison. Perhaps the priesthood, at various times and in various places... created a sort of prison type situation where men who would have preferred to be with other ADULT MEN, instead turned to what what available.
I'm honestly not sure, I know that a lot of homosexual men would be very insulted at any sort of conflation between that and pedophilia, and I can understand why. Still, there may be something to this prison analogy. Sure, there would be the fellow adult priests... but your entire world could blow up in your face if you propositioned another priest and had misjudged them, either finding out they weren't gay or that they were too closeted to be receptive and instead exposed you, denounced you, etc.
Whereas altar boys might be viewed as controllable due to the position of power the priest had over them. Power often leads to abuse. Whether it's the female intern or the male altar boy.
These are just some conjectures, I'd be curious to hear anyone else's thoughts on if there seems to be any merit to them.