I agree that such rules, which even certain federal courts and even the Civil Rights Act don’t support, are prevalent in almost all IT and software companies and there is not much one can do about that.
All these codes of conduct formed around the dressing and styling of male and female employees have gender and sex stereotypes as their basis, and hence can also be accused of discriminating the employees of a company on the basis of their sex.
(Courtesy: Money Crashers)
You ask why such rules have been made, and for this I have only one answer –that these rules just follow the line of gender stereotypes telling their employees what they are supposed to wear and what not. Following such a dress code in software companies which are mostly service based make the employees look more presentable in front of their clients. Hence to be on the safest side, it’s best to confirm to the stereotypes already made to look pleasing to an alien eye.
So it may seem to you that the restrictions are only to men, but if you dive a bit deeper, you would see that women face as much exploitation and discrimination as men do. It’s true that women can wear knee length dresses and sleeveless blouses while men cannot, but there is a whole code of conduct issued even to women for their dressing and styling.
For example, women cannot just style their hair in any which way they like. They have the liberty of keeping their desired hair length, but not the liberty of choosing the way they will style their hair. Also, women at some places are expected to always dress up femininely.