Dear Saritha,
Your industry is famous for having an informal working style. The employees do not like the imposition of any rules. Most of them are well-educated and knowledgeable too. Nevertheless, a little do they understand that education or possession of knowledge does not make one wise.
Against this backdrop, you could have called the town hall meeting and explained the importance of the dress code. You could have told that for the want of proper dress code, it is impacting grooming standards which in turn, projects a wrong brand image of the company.
Thereafter, you could have invited the suggestions on having a dress code. Since this is a beginning, you could have implemented what was being agreed by the majority. You could have repeated this exercise after a year or two to elevate the standards of the dress code.
With this participative management style, you could have overcome the resistance from the employees. I doubt whether you had taken the employees into confidence. Since they were not taken into confidence, you had to face the backlash.
Thanks,
Dinesh Divekar