Well, Mise, I have some good news for you. I work at a place without a dress code most of the time, and to date, I've never seen someone come to work in the nude, or even in really sleazy attire. So, it seems that the human race still has a sense of dignity, after all.
Socialization probably does have something to do with it, but even so, it's reassuring.
Despite that, I think employers do have a right to set a dress code should they so choose. Most employers will be sensible - my last employer's dress code was reasonable, and my current employer's dress code for business trips is as well. I do think that religious garments such as turbans should be respected. I don't think it should be illegal to require everyone to wear pink shirts and yellow bow ties, though. If a new employer did that, they'd have a hard time recruiting anyone to work for them unless they were extremely quirky. If a large employer did that, probably no one would follow the rule, and it would just be a joke whenever a new employee started to see if they showed up in a pink shirt and yellow bow tie the first day.
And it is a trade-off. Firms with strict dress codes probably lose potential employees who love their mustaches, and Best Buy probably has lower quality tech support because they require their geek squad to drive around in hideous-looking Beetles. On the other hand, in some professions, the "professionalism" conveyed by the dress code probably does significantly affect business.