I hate to say it but dress codes are in place for a reason.
Whether or not this specific instance makes sense or not, i don't know.
I DO know that there are enough parents and kids out there that will try to get out of a situation by pointing out that others were not treated the same way. Maybe that had something to do with whatever happened.
Speaking as a teacher, I know kids who could wear anything they wanted in my classroom if I had MY way because they were good kids. On the other hand, there were some kids who would take a lapse in dress code as another excuse to cause some sh*t.
Speaking as a parent, I would probably try that "You're singling out MY kid" defense if I didn't want to deal with the issue.
If you apply those ideas to the situation you were upset about would it make any difference?