Well, I believe that the dress code doesn't have any effect on the way people work. However, it is an indicator of 'discipline'.
As Kidakaka said, there is a difference between discipline and professionalism. In my opinion, professionalism is related to the way of working and it should not be affected by the way you dress.
I was wondering why Indian IT Giant Infosys asks its employees to follow different dress codes on different days of week ( Friday -> Casuals can be understood

)