In the past there were more surplus men who knew they wouldn't have the financial prospects to raise children. Many of them were orphans who were raised in the church. They didn't enter the priesthood for the most noble of reasons, but were generally good people who wouldn't stand for one of their colleages banging the altarboys. This kind of institutional priesthood has disappeared with affluence.
The other thing is that the celebate priesthood hasn't been around for nineteen centuries. The celebacy requirement came about in response to an earlier nepotism crisis. And later on still, pedophelia in the priesthood wasn't much of a problem when it was generally assumed that priests would have mistresses from time to time.
Homosexuals and homosexual pedophiles enter the Protestant ministry and the rabbinate as well. They take jobs as coaches, daycare workers, teachers, even ride operators at Disneyworld.
There are clerics from all religions who abuse their positions in order to get sex. But this still doesn't explain the peculiar tendency towards homosexual abuse in the Catholic Church that is not evident in other religions. When Baptist ministers or rabbis seduce a young teen, it is usually a female.
Before 1963, these problems were almost unheard of. There is a good reason for this.
These problems were heard of, just not spoken of. We are now hearing of grown men who were molested back in the '40s and '50s who are coming forward. When I was younger my dad warned me he heard stories about these kinds of things when he was growing up.
In short - Freud is wrong, not St. Paul.
Indeed, Paul is not wrong. In fact, he stated in one of his epistles that church leaders should have only one wife, which clearly supports the idea of a non-celebate clergy.
For I would that all men were even as I myself. But every man hath his proper gift of God, one after this manner, and another after that. I say therefore to the unmarried and widows, It is good for them if they abide even as I.
1 Corinthians 7:7-8
He that is unmarried careth for the things that belong to the Lord, how he may please the Lord: But he that is married careth for the things that are of the world, how he may please his wife.
1 Corinthians 7:32-33.
Which tells us that St. Paul recommended celibacy, and that the noncelibate clergy represented a compromise, a legitimate nod to human weakness.
In any event, there are hundreds of married Catholic priests who are loyal to the Pope and in good standing with him.
They just aren't part of the Latin Rite, which is only one of the eleven Rites that comprise the Catholic Church.