

I have the unpopular opinion that dress codes are a good thing for a good reason. But the problem is that it gets enforced unfairly (like, by how sexually attracted or threatened adults get). Like your situation, the teacher basically said “Your ass is so ‘distracting’ in those tight pants I need you to stay right here alone with me after class for a while and keep on ‘distracting’ me.”
But a clearly defined dress code meant to prepare youth for a future where they have to work on professional settings (notice that has nothing to do with “distractions”) helps to keep the focus on becoming competent adults. Not on asses and boobs. Most people’s future bosses don’t give a crap about your self expression and just don’t want to deal with complaints from coworkers or customers. I think I got this mindset when I was 14 and worked at a Dairy Queen with a seventy year old crack whore who often paraded around in yoga pants (before they were a thing) meant for 12 year olds and would say things like “I can’t wait to go home and get naked.” No one there wanted to think about her naked.
To be fair, your dad was probably just as scared of your teacher. Same with the principal.
If I hadn’t had a dad who was a school counselor in my district used for all the worst problem kids I think I would have had a different experience. I wasn’t a bad kid, but I was a weird one. As a result I got to see behind the curtain a little and think office politics plays a bigger part of why kids get in trouble than anything else (well, except actual parent involvement and how you raise your kids). Now that you mention this I think I’ll take my youngest to get her eyes examined just to be safe.