To keep little thugs out. And to help kids understand there are rules in life. Everybody has to conform to certain laws and rules. Certain jobs will require a uniform, or certain dress. All NFL players wear matching team uniforms, NBA players too, as well as McDonalds employees or the local Home Depot employees wearing orange aprons. In a clothing store, a certain standard of dress may apply in order to work there. Its about preparation for the real world. Even thugs dress in their own style of uniform...that's why they're easy to spot...and...they like advertising the fact that they are a thug.
So that no one get's the superior feeling over others and to have uniformity.Some people may be poor and can't afford good clothing or other stuff you know and when they see other people of their age showing off(it's what they actually do..or even if they don't it appears like that) they get disappointed or even irritated maybe.Feels like why can't we have lifestyle like that.They first become jealous and then it turns to hatred and you know what happens after that
so all are equal and it looks like a place to study .... where all are equal and not a place where students show their social and economical status ... and schooling has to be under some rules and customs, which has to be followed.