The problem with younger kids is that parents don't follow the dress code - they don't stay up to date on the code, or they let the kids run the show at home and bully the parents into acquiescing. Older kids definitely wear something else underneath or take a change of clothes with them. That's harder to police at the moment, but all kids are relatively easy to discipline if the parent is willing to be the bad guy and take away privileges.
Uniforms take away the competition and can be a bit of a savings for parents on limited incomes because there is less pressure from the kids to go shopping and buy stuff that's trendy. However, parents do have to buy 5 uniforms per child, or they have to do laundry a lot - that's a problem for parents working 2 jobs and with limited time and several kids. On the other hand, they can increase the competition outside of school. Ideally, we wouldn't judge each other or allow our kids to judge each other based on appearance so none of this would be necessary.
Kids fight limits and they test boundaries. If it's not with clothes, then it's with something else. When I was teaching, we kept a supply of clothes (donated by parents usually) for emergencies. Younger children always had a full change of their own clothes that allowed for bathroom or lunchroom accidents (or stomach flu to clean them up until they could be picked up to go home). But after about 2nd grade, kids don't want to do that and it's not usually necessary. But we still had a community closet that included clothes for a child who ripped a shirt or fell in the mud at recess, and it covered kids who wore inappropriate clothes (adult sayings on tee shirts, girls with spaghetti straps or tube tops, too-short or too-tight things, etc.). The second those inappropriate clothes are confiscated, the kid stops getting a rise out of the crowd. The offending item was sent home in the backpack with a note (if too revealing), or held for the parent to pick it up (if an inappropriate or drug-related saying, for example). When the child missed a favorite activity (which we made sure of), they didn't usually wear that item again. If they did, the consequences were more significant.
I think uniforms are a shame if they replace responsible community building and effective parenting. That means a strong bond between teachers/staff and students, and school-wide values. I agree with Mel R. that uniforms should not require skirts on girls - that inhibits their ability to play at recess and it's sexist. I agree that girls should have a choice. I don't think boys should have to wear a tie. Around here, most schools that have uniforms have khaki pants and a shirt with a collar (polo shirt, for example) in a plain color, usually white or beige. Overall, I think the problem with uniforms is that they are a big outlay at first for enough changes that there isn't a laundry night every night of the week. And if you're washing every night, the clothes wear out sooner, so you're replacing them anyway. Kids who outgrow clothes are a problem too, although with uniforms some schools will operate a swap night or exchange.
And if we can't teach kids to stop teasing about clothes, then they will move on to some other category - so we really need to have a climate of compassion and acceptance. It starts at home (one would hope) but it can be encouraged and nourished as part of the school values.