The purpose of school is to prepare children for adulthood.
Adults have to know what situations are appropriate for what items of clothing. These social cues surrounding clothing are not inherent, they are learnt. Letting children and teenagers make a social faux pas at school will help them learn what items of clothing are appropriate in the workplace and what aren't. It will help prepare them for adult life when they have to select their own clothes every morning. This is even more important in the modern workplace, where more offices are doing away with suits and ties and allowing workers to come to work in jeans and a t-shirt.
Schools are preparing children for adulthood by having a uniform code. Very few jobs in the working world allow employees to rock up to work wearing whatever they like. Most offices and workplaces have a strict dress code, often requiring suits and ties or business attire. Even informal jobs like delivery drivers, cashiers, and gym instructors usually have a uniform of some kind. Getting children into the habit of wearing a uniform to school every morning is preparing them for the working world, where they will most likely be expected to put on a uniform each day.
[P1] Schools are supposed to prepare children for adulthood. [P2] In adulthood we have to choose our clothes each morning. [P3] Therefore, at school, children should have the freedom to choose their own clothes.
Rejecting the premises
[Rejecting P2] In adulthood, we have to wear a uniform or dress code for most jobs. [Rejecting P3] Therefore, to best prepare children for the workforce, they should have to wear a uniform to school.