A thought experiment
In DnD alignment terms, I probably waver between Chaotic Good and Neutral Good. I'm definitely not Lawful Good.
Lawful Good alignment also gets called Lawful Awful or Lawful Stupid to describe twisted decisions in accordance with the rules that go really messed up places.
The example I typically give of this is Princess Elspeth in the movie Dragonslayer replacing all the lots with her name and throwing her life away because she learns her name has always been kept out of the lottery.
She could have done some math and put her name in multiple times or something like that. Instead, she makes her name the only one, deciding on her own to DIE to make up for her father keeping her name out of the lottery her whole life.
It's a pointless sacrifice because it doesn't rid them of the dragon, unlike the death of the elderly wizard in the movie, and it doesn't bring back any girl who theoretically may have died in her place.
It fixes nothing in actual reality and provides no objective justice of any kind. It merely satisfies some twisted, neurotic concept of Goodness in Accordance with The Rules internal to her psychology.
She's basically a spoiled, rich brat whose privileged and sheltered life has lent itself to her valuing some kind of abstract concept of justice in strict accordance with The Rules, as if she is unaware that rules and laws are written by people and aren't inherently sacred or perfect. Furthermore, they need to be administered by a wise individual, like a judge, in order to serve a healthy societal function.
There's far too much of this kind of garbage in the world, a la the Catholic Church covering up the crimes of pedophile priests and moving them elsewhere, presumably "to give them a second chance." It amounts to aiding and abetting child molesters because I do not believe there is ANY hope that merely saying "Don't do that again" does ANYTHING to reform a child molester.
Instead, I believe that pedophilia is most likely a head injury syndrome, not all pedophiles (people who find kids sexually attractive) are actually child molesters and IF it's fixable, you would need to both find an effective medical treatment for the brain damage and some kind of intensive therapy to help them remap their sexuality.
I believe that in a complex world where far too many bad people actively look for loopholes and both expect and ARGUE that "good people" MUST always be honest, open, follow the rules etc., when decent people act in accordance with that expectation, they essentially aid and abet bad people.
I think actually decent people are allowed to make judgement calls that take into account context and nuance and which actively sabotage efforts to twist the rules into a means to consistently let bad people win or get off light while everyone bends over backwards to "understand" and give them a second chance, a la my speculation that the police may have decided that the man who raped Maya Angelou as a child deserved to die for that, her uncles probably killed him and the police were going to let cultural racism cover their decision to not prosecute her uncles for doing the right thing.
Let's hypothesize a world in which:
1. There's a cure for pedophilia BUT you have to WANT to be cured. There's no means to FORCE you to fix it.
2. Some pedophiles are making a good faith, sincere effort to fix their problem and stop molesting kids.
3. Some pedophiles are happy to CLAIM "I'm working on it" and "It's not my fault because I got hit in the head as a kid, so you aren't allowed to punish me" while they continue molesting kids and have zero plans to ever stop.
Let's hypothesize that YOU are a Catholic Priest in this hypothetical world and CAN potentially give people useful information for treating it and are happy to help people recover and stop being child molesters and keep their secrets to facilitate recovery, but you have a moral dilemma because some child molesters clearly are using confession as a means to get their sick jollies at your expense, make themselves feel fine about their heinous crimes -- because you are obligated to tell them over and over "Your sins are forgiven" -- and clearly aren't treating it and have no plans to treat it.
Could you decide to keep the secrets of SOME people because they are making a good faith effort to fix it while calling an anonymous police tip line to report the ones you are certain are misusing the confessional to both victimize you as part of their warped garbage and assuring themselves "I can abuse all the kids I want so long as I go to confession regularly and get officially forgiven!"?
The Bible says go make amends to people you have wronged before you go to confession. Confession was never intended to be a means to help people feel fine about choosing to harm others and commit crimes and continue doing so on an ongoing basis while your priest is forced to aid and abet after the fact by keeping his mouth shut, knowing you will absolutely do it again but perhaps feeling like the confessional is "sacred" a la some Lawful Awful mindset.
But if there were a cure for pedophilia, perhaps some priests might choose to view the confessional in a more nuanced fashion as having a function intended to make a safe space for people trying to do the right thing and fix their problems and feeling they are not obligated to aid and abet child molesters with zero plans to fix it. That's a bastardization of the purpose of the confessional and they are not only NOT obligated to cooperate with its misuse, they feel morally compelled to oppose its misuse.
And an anonymous police tip line serves a similar societal function to the confessional of making it safe to speak the truth for the purpose of trying to address problems effectively that are actively kept alive when there's no safe way to speak of it for ANYONE, not even those trying to do the right thing.
When conditions on the ground change, it's not unreasonable to revisit the rules we have and potentially reinterpret them or update them. It is theoretically a situation where priests could be forced by circumstances beyond their control to choose between their job and their conscience or their job and a jail sentence if the world wants to start dragging priests into court for covering up crimes.
So perhaps some priests decide that if pedophiles don't want to fix it and they get tired of hearing them gleefully brag in confession every week about how many kids they molested and gloat about how the priest is required to keep their secrets, maybe some priests decide they don't have to keep those secrets and thus don't have to agree to be yet another victim of some sicko taking glee in pissing all over someone who is celibate and has dedicated their life to serving the greater good.
They can decide "My job or my conscience? I would rather sleep nights, though hopefully it doesn't come to that. Polluting my mind with using me to be icky to more people and feel okay about their heinous crimes is not the purpose of the confessional and I'm willing to argue that with the Catholic Church if I MUST."
Footnote
Article loosely inspired by having seen the Hitchcock movie "I confess" years ago and read an article about it that indicated he did the movie in part due to being wrongfully accused of something as a child.
Also loosely inspired by my first therapist, a former Catholic priest who left the Catholic Church and I think became a Baptist minister, nominally because he fell in love with a French ballerina, whom he married and had kids with, though there may be more to that story because he was also giving Communion to excommunicated Catholics.
Last, I will note that laws and rules are often far from perfect and are sometimes intentionally evil garbage, a la Jim Crow laws that were explicitly intended to deny newly freed Black Americans legal rights.
Life has made me feel more strongly, not less than I did in my youth, that Lawful Awful personalities are frequently intentionally evil people whose real goal is evil while Looking Good to help cover their butts and provide plausible deniability. They often aren't merely naive, foolish or neurotic as Princess Elspeth seems to be.