Schools that have dress codes are hippocrates. At school, they try to encourage you to be yourself. I myself like to be different, I don't like to dress like the average person. I want to express myself freely, how could anyone do this with a dress code?
Not really, sad to say, it's a very narrow mindset if you think that way.
Elementary school yes, because there's a need for them to understand the importance of having a strict dress code in some of the professions in the society.
Elementary school, yes. (Well I googled to find out that age range for elementary school cause they don't call that elementary school in my coutry )
I am brought up in an environment like this. When kids are small, they might be subjected to point of views due to looks, ect ect. The amount of money a family has to doll up kids also ranges from people to people. Kids when small, might not be able to handle the feeling of inferiority(or whichever way it's spelled) or being an outcast just because they are not able to be dolled up like a princess by their parents.
It also enforces discipline on the students as they have to adhere to a certain dress code by the school. It's more values in it than just "HEY, Stick to the frigging dress code".
It differs from country to country with different ways of imparting the values and might be seen as more conservative, but that's the way I am brought up haha.