Rules about clothing vary greatly between workplaces, from strict uniforms to complete freedom. While some argue that employers have every right to insist on formal dress, others feel that staff should choose for themselves. In my opinion, dress codes are justified in roles that involve the public, but elsewhere employees should be given considerable freedom.
Those who support formal dress codes believe that appearance affects how an organisation is perceived. A customer visiting a bank or meeting a lawyer may feel more confident in the service if the staff look professional and smartly dressed. Dress codes can also create a sense of unity and remove distractions, as nobody needs to worry about whether their outfit is fashionable enough. For jobs involving safety, such as construction or laboratory work, specific clothing is of course essential rather than optional.
On the other hand, many people argue that what employees wear has little connection to the quality of their work. A software developer who spends the day writing code is unlikely to perform better in a suit and tie, and may actually feel less comfortable and productive. Allowing staff to dress as they choose can also show that an employer trusts them as adults, which may improve morale. Furthermore, strict rules can sometimes conflict with religious or cultural dress, and employees may feel that their identity is being disregarded.
On balance, I believe the right approach depends on the nature of the role. Where staff represent the company to clients, it is reasonable to require a smart standard, although rules should be flexible enough to respect cultural and religious needs. For employees who rarely meet the public, comfortable everyday clothing is perfectly acceptable.
In conclusion, employers may reasonably set dress standards for customer-facing staff, but in most other roles employees should be trusted to decide for themselves.