I suppose the word got out that being a priest was a safe profession for pedophiles so they congregated in the Catholic Church.
I think the core problem is a "perfect storm" of shame and denial around sexuality, the nature of the celibate priesthood, and the pressure to be seen as not just merely competent, but morally, ethically and in every way better -- while still having the same basic drives and needs as everyone else.
Also, in the same way that people with mental health challenges tend to be attracted to psychiatry / psychology as a way of rendering their own issues explicable and tractable, people are attracted to the celibate priesthood as a way to try to cope with their own (often largely denied) impulses. Except that the church offers no real help with these issues, just repression, so all it actually does is create a pressure cooker / cauldron of self-loathing.