This is one of those things we've learned to do not out of ideal moral principles, but because the consequences of not doing it are so much worse.
The first beginnings of what would grow into modern concepts of religious liberty in Europe came out of the Thirty Years War. Millions died in the fighting, most civilians. When both sides think God's on their side, and that giving in will mean eternal damnation? It's gonna be ugly. Through this and other wars of religion, we learned the hard way to take a "live and let live" attitude with certain religious practices.
Religion makes people do terrible things. When someone truly believes their eternal soul is on the line, there's very little you can actually do to change their behavior. There is no punishment you can apply to them that is greater than an eternity in literal Hell.
I'm in favor of letting priests keep their confessions secret. First, forcing them to reveal confessions isn't going to actually help catch any abusers. If you establish that policy, even if you get the priests to go along, all that will happen is that priests will tell people before every confession. "Please note, there are some crimes I'm required by law to report." In that case, no abuser will confess their crimes to a priest. At least now there is a chance the priest can convince the abuser to seek out redemption and turn themselves in for their crimes. And if someone cares enough about religion that they're willing to confess molesting a child, they're probably on the verge of turning themselves in anyway. I would rather the priest be able to hear the confession and tell the molester, "the only way you will not go to hell for this is if you turn yourself in." That would at least result in a nonzero amount of predators being caught.
But historically, forcing people to violate their deeply held religious beliefs rarely works well. It's a short hop from "I will die for my religious beliefs," to "I will kill for my religious beliefs."
I don't support forcing priests to reveal any crimes confessed to them. Ultimately it won't catch many criminals, and it comes with a lot of risks. On the low end you end up risking locking up nonviolent priests for decades for no other crime than sticking to their sacred vows. On the high end you risk religious violence.
It's not something I support in principle, but merely out of practical reality. I'm agnostic myself. I just think forcing priests to report does more harm than good.