There is no Biblical basis for the celibacy of Priests, and that practice leads to this sort of thing.
In other church settings, it's simply because church is a place where sickos can gain access to kids.
I agree with the second part, but I don't think priests having to be celibate results in them having sex with kids because that's the only group they're around. There's way too many stories of them banging kids rather than of age women/men, although we don't hear about the later because, you know, it's
legal.
I'm not really religious, but I was confirmed as a Catholic and have taught in Catholic schools, so that's some of the insight I have based upon my experiences.