

You act like excommunication is only a slight matter. For someone who is not religious, being kicked out of a religion might not sound like a big deal, but compare it with citizenship/nationality. Crimes have punishments, so something like murder might involve decades in prison. In the Catholic Church, a priest who murders (or rapes or whatever) might be defrocked, or alternatively sentenced to spend the rest of their lives in prayer and solitude, but part of the essence of Christianity is the belief in forgiveness. Excommunication is more akin to stripping citizenship. The US (despite what some people currently im power might want) doesn’t allow stripping citizenship from people who commit regular crimes, even serious ones like murder or rape. Imagine if every murderer or rapist in the US got their citizenship revoked and not only permanently lost all rights (from voting to housing) but could then be deported. Well, I’m sure the uproar that would be caused by even suggesting that. Well excommunication is like that. It is only permissible in certain very tight circumstances where something that fundamentally goes against the entire Church takes place knowingly and intentionally. It would be akin to something like high treason or whatever if I had to draw a comparison, which many countries do have an exception for the absoluteness of citizenship/nationality. There are few instances of excommunication that I can think of in this day and age, but a few would be breaking the seal of confession, breaking the secrecy of papal conclaves, attempting ordination outside of what of permissible while disobeying local bishops, and heretical schisms attempts I guess and all of these mostly for priests and bishops since they have a higher standard and pastoral/leadership responsibilities.
If lawyers had to report the worst types of crimes committed by their clients, or ones they suspect them of having committed, don’t you think that would break down the legal system? So too with confession. For it to work, there has to be absolute secrecy. Punishments can apply anywhere else, investigations, reporting, whatever. But there fundamentally must be at least that one avenue for an individual to get legal help that is there for them and only them, or to have a priest hear their sins on behalf of God and offer absolution. Without secrecy, both structures would break down and a fundamental part of the legal system is the right of everyone to defend themselves, and a fundamental part of Catholicism is the availability of God’s forgiveness of sins.