Blimey, who'd be a teacher? I hope that none of the people here who are advising telling the teacher to **** off / write to the DM / complain to the Governors / just ignore them because they have no authority / threaten to sue them are the same people who complain about reducing levels of respect in society / reducing standards of behaviour in schools.
MarkF: great sympathy to your daughter. I hope you find a way to resolve this. My own suggestion would be (a) to talk rather than write a letter in the first instance (b) to start by stressing how you appreciate and support the school's uniform and behaviour policies, but requesting that under the circumstances they make an exception.
I wouldn't be a teacher, but I do expect those who choose to do so to do it properly, and not use it as a springboard for their power-kick control-freakery, at the expense of the people they're paid to care for and teach - and not just in 'their subjects', but in how to behave.
The PE teacher's utterly stupid dictate, as described in the OP, should not be tolerated: it should be confronted, traced back to source, and squashed. Maybe it isn't the individual teacher's decision; maybe (s)he is just enforcing school policy. In which case, school policy needs to be changed, because it's stupid. It serves no purpose, and simply provides an opportunity for bullies to bully. No way would I
request exemption from such a stupid instruction; I would
refuse to comply with it. And if I was in the right mood, I would pursue it till I found out why it had been made, on whose authority, and what changes would be introduced to prevent any such ever being made again.
None of this would do anything to reduce levels of respect in society, or standards of behaviour in schools. Quite the opposite. It would reinforce a key underpinning for such respect and standards: that authority has to be validated by responsibility. Power used to bully is power abused.
That is a bad lesson to endorse, anywhere - but most particularly in a school.