It is a crap analogy though as the driving thing is about the criminilisation of an individual.
The teaching thing is about crowd control. Usually for the good of all. If it takes a long time to find out who the culprits are the good kids are missing out on teaching time. Its a lose/lose situation for the good kids.
However this does reflect the outside world in the following way:
We do have this stuff applied to us as children and adults outside of school in the form of all the crappy rules and regulations (indeed laws) that don't apply to us as individuals but that we are all being punished for in advance because of the minority who are antisocial/criminal/selfish, etc.
I'm sure you can all think of many examples where we all have to suffer because of the few: airport checking in searches anyone??