I had teachers who did shit like this. They were always miserable, vindictive, spiteful and would always punish the whole class when a few people at most acted up. It even caused a chain reaction of punishments from multiple teachers for me amd some others.
Bullies never got punished harshly especially individually. But somehow as one of the hardest working, most earnest/sincere, sensible, easy going students , I was brutally punished at times for shit that wasnt my fault like I was their metaphorical punching bag.
I fucking hate power trippers like this who take out their misery on everyone because one or a few people upset them. Sometimes it's just people calling out their toxic behaviour but these authoritarians freak out and hand out their own form of self righteous punishment on everyone anyway.