They taught me this in primary school; when you're in public wearing the school uniform, you are representing the school. As such, any misbehaviour (i.e. smoking in the nearby underpass) will be punished by the school.
And, because you can't measure the school by the individual, you can't measure the individual by the school, either. If a school has a reputation for kids behaving badly, that probably just means that a bunch of the kids who go there, who don't want to be there. Whether they wanted to be there when they arrived at the school is a separate issue, amenable to causal analysis.
...Now, similarly, a lot of people are forced to work at jobs they hate for a paycheck...
edit: just noticed the another commenter already pointed this out to you.