You basically described the adult world. While our justice system isn’t perfect, it helps to curtail the chaos caused by the “thousands of weirdos and anti-social” adults.
I don’t claim to know the intricacies of this problem but it seems directionally correct to have such a thing rather than not.
The goal shouldn’t be to necessarily punish kids but to better identify issues and rehabilitate kids. The school systems are currently turning a blind eye and letting problems fester and compound. That is not the way to go.
From what I understand, there are legal implications for teachers who intervene and this prevents them from doing anything even if they wanted to. We can definitely do better.