I'm gonna elaborate on your point a bit.
I understand that "why punish the good kids for the behaviour of the hooligans?" makes perfect sense to some people, so let me give you an example. I'm going to use four renamed children as an example.
I was teaching Year 7, and I noticed that the really kind and friendly Susie Jones was acting oddly scared. I looked out of the window and saw Jacob Brown and Johnny Smith in Year 9 looking in from outside, making gestures towards her. This continued for a while, including them shouting into the room. In the end I locked the door, hid her, and sent for on call to come and help. It turns out that Susie reported Jacob for misbehaving on the bus and for several days they had been arranging a time to get out of lessons, find Susie, and scare the living hell out of her through classroom windows and sometimes by booting the door open and throwing stuff at her.
Some context here: The school tried to have Johnny permanently excluded the year before but it was overturned by the local authority's independent review on account of the fact that he was too smart to go without education for the time it would take him to find a new school.
The next day we got an email from SLT telling us to never, under any circumstances, allow Jacob or Johnny to leave the classroom. Later that day I had Johnny in my class. I noticed Jacob lurking out of my classroom window. Then, Johnny loudly shouted "I'm desperate, let me go to the toilet". I said no.
A few minutes later little Maya Johnson came to me and whispered that she had started her period and needed to go to the toilet. She is absolutely a delightful student so I trusted that she needed to go. I whispered to her to pretend that she was collecting something from another classroom for me, and told her to go - but she had to get pads out of her bag first, and of course, Johnny noticed.
Over the course of the next 20 minutes, Johnny began YELLING "I WANT THE TOILET I WANT THE TOILET I WANT THE TOILET LET ME OUT I WANT THE TOILET I WANT THE TOILET". I sent for on call but on call was busy dealing with Jacob and several others. Johnny then degenerated into hurling abuse at me. "I WANT THE TOILET, LET ME OUT, SIGN THE LOG YOU STUPID F-ING GINGER C" at me, and variations of the same.
When I refused to react and just waited for on call, he turned his attention to poor little Maya Johnson. Since she'd been allowed to go, he turned his rage onto her and began insulting and mocking her. At this point I asked Johnny to go into the classroom next door (for Maya's sake). He refused. To try to save Maya I even told him fine, go to the toilet, even though I knew that meant that he would seek out poor Susie. He kept hurling abuse at Maya, so I escorted Maya to the door, removed poor Maya from the classroom, and told her to go to a specific other teacher, then had to stand in the doorway to block Johnny from following her.
"Keep the naughty ones in the classroom and let the nice ones go" doesn't work, either. It just turns the teacher and the nice students into targets for the rage of the naughty ones.
I don't know why our society is like this. I never witnessed anything like this while I was at school. But this kind of behaviour is commonplace across the country now. I don't know how to resolve it other than campaign for more funding for schools so that we can afford to pay for full time toilet monitors and escorts. But when we campaign for better funding, all we hear is "lazy teachers are overpaid and already have too much time off".