There are obviously some good, commonsense rules for uniform, like wearing leather shoes to protect your feet and that sort of thing. Uniforms beyond that are about the exertion of authority on students, the cultivation of equality (it's more difficult to differentiate people when they all wear the same thing) and to minimise distractions. I think that some schools do go over the top (for instance, I know someone who got suspended because they failed to wear their school hat on a train or tram, which is just plain silly), but I seem to remember to prefer having a uniform, because then getting ready for school was much easier and quicker.
When I was in around year 9 or so, we got a new vice principal who was really harsh on uniform. Our uniform changed from polo shirts and stuff to 'proper' shirts and the option of wearing a tie, and the school logo becoming emblazoned to the pants. Nailpolish, bracelets, hairdye, necklaces, dress and sock length became consistently under scrutiny. On the one hand it was a total waste of resources and teacher time trying to control what is a pretty trivial matter and parents having to buy so many new and expensive clothes. On the other hand, I think the change of dress did give the students some more self-respect somehow, maybe just symbolically. I'm not sure whether or not it's worth it. I think you could probably cultivate self-respect in some other less expensive yet more radical way.