I'm with janea on this. It's all about reasonableness. And management prerogative. Is it reasonable for a company to stipulate that a worker adhere to a dress code? Yes. Is it reasonable to insist that the wearing of heels of 2" in height is a condition of employment? Ummmm..maybe not.
Was the company discriminating on the grounds of sex? I don't think so. Men, as a rule, do not wear heels. Women, however, do. There is an expectation that some wear heels, at least sometimes, and that it may therefore be reasonable that a dress code for women incorporates heeled shoes, for whatever reason the company decides. So adherence to the code becomes part of the employment contract, and the worker abides by that. Failure to do so is a breach of contract on the part of the employee.
I'm interested to know at what point the woman in question decided that she wasn't going to wear heels. If she'd signed the contract, she was agreeing to its terms. She knew what was expected. And as to being "forced"?. I don't think so. She had a choice; she could simply have turned down the contract and said "no".
As to whether it is "reasonable" to insist that females wear a heel, then management will do whatever it can get away with.