Largely by a mixture of hypocrisy and commercialism. Catholicism has struggled mightily with this issue throughout its history, and is a big part of the reason that Protestantism even exists today. Get it, "Protest"ant? When people claim to hold values, and then act in apparent contradiction of those same values, it doesn't exactly inspire one to themselves adopt those values.
And that's been a major player, especially in the West, for the past ~70 years where you have politicians wearing religion on the coat of their sleeve, and then going and killing hundreds of thousands of people over what is overtly about oil, economics, and geopolitics - lofty moralistic rhetoric notwithstanding. Then you have things like the pedophilia scandals high within the Catholic hierarchy, made even worse by coverups.
This is probably why religions like fundamental Islam, Haredi Judaism, and so on are even more heritable. Those who follow such religions tend to very much live their proclaimed values. For instance I really don't agree with people like Khabib Nurmagomedov on many of his values, yet he lives those values, even when they hurt him in the short-run, and I find it very inspirational. I can only imagine how young (or older for that matter) Muslims see him. Integrity in life is just so important.
Definitely, our children do not learn so much from our words as much as from our behaviors and actions. Religious individuals like to claim that the decline in religiosity drove a decline of morality in society. I think it's rather the opposite - that a decline of morality in society drove a decline in religiosity.
It's like a parent trying to teach their child about healthy eating while they down cokes, chips, and sweets every day. That kid is going to be much more likely to, himself, end up downing cokes, chips, and sweets than he is to eat healthy. And for his own kids, he may not even bother with the pretext of healthy eating.
Morality is relative. But from my worldview the perpetuation of a culture, and a society, is the first and foremost requirement of any successful culture or society, and arguably the single most primal responsibility of the people within that culture and society. This overlaps well with religion, but not so much with what I assume you might consider moral or amoral given your comment.
> But from my worldview the perpetuation of a culture, and a society, is the first and foremost requirement [...]and arguably the single most primal responsibility of the people within that culture and society. This overlaps well with religion,
I was agreeing with you, if not prescriptively, at least descriptively.
On that I would disagree. Had the Catholic Church chosen to take severe actions against the pedophiles, defrocking and even excommunication in severe cases, I think they would be in a far greater position today. By protecting the pedophiles, they have greatly imperiled their own authority and ability to persist into the future.
This gets back to the original discussion we were having about hypocrisy. Far lesser ails led to the Protestant reformation. In this case, alongside the dysfunction in the College of Cardinals, there will be no reformation but simply a decline.
I wouldn't say this is entirely accurate. For instance there's some irony in that the reason Priests can't marry is, in part, because of draconian measures against priests abusing their power by essentially establishing fiefdoms composed of Church lands and property. Local priests would control such property and then pass it onto their heirs, appoint family members to important positions, and generally just treat it their own little demesnes.
The Church responding with 'you can no longer get married and shall have no heirs' was a very serious FAFO moment. Just think about how huge a deal that is, if you can even imagine it! The Church used to make much more effort to abide their values, very much in the way that e.g. Islam does today. The centralized nature of the Catholic Church means this (the pedo stuff) could easily be rectified by a single person, the Pope, but their failure to do so is also what I was alluding to with the dysfunction in the College of Cardinals (which is whom elects the Pope).
basically religion worked so well that it stopped working.
I think they got caught with their pants down due to progress in communications. there was a time they could suppress information and get away with it. they didn't realise soon enough that the world had changed. in fact secularism helped give a refuge to the victims - if the highest law of the land was the church, then the old ways would have worked just fine.
I don't see how you can reconcile this with their past actions, like the prohibition of marriage or even the appointment of heirs - all as a effort to clamp down on abuses. This is what I was getting at with their historical actions prohibiting marriage. Imagine you live in a time where marriage was completely legal for those within the Church and then, as a punishment, they completely forbade it as well as the designation of heirs. That degree of extremism, in pursuit of a moral goal, is completely unimaginable in modern times - in most of any context. It'd be like combating corruption by requiring politicians give away all belongings when entering office and prohibit them from monetizing their time in office after leaving. That's just inconvenient, so it'd never happen.
In any case I suppose now we're looping back around to the original point that we started bickering on. I think the problem is that society has become broadly more amoral, including religious leaders. If one cannot lead by example, then one cannot lead. I think this is the exact same reason that government systems are also failing. It'll be interesting to see where and what this culminates in, as I expect it will happen without our lifetimes.
As for the Church, it was (and remains) never too late to pull a Hollywood. Hollywood had been making not entirely subtle jokes about Ratner, Weinstein, and all of these other guys for decades. Everybody in Hollywood knew they were sex abusers, but it's only when it became clear that they were beyond the point of no return that Hollywood was like 'oh my gosh, that's just so unacceptable, I can't believe you'd do that, away with thee.' But of course doing that would be inconvenient, so again - it'd never happen, certainly not with the current leadership nor cardinals that elected them.