@Elmithian She's enforcing the school's rules, and Mahiro manages to keep breaking them. We know it's accidental, but she doesn't know that, to her it appears like purposeful rule-breaking by a serial rule-breaker. She'd probably have been less harsh to one of the other girls because they hadn't broken the rules before.
Now the strictness of Japan's school rules, especially as they pertain to girls,
are rather ridiculous, but that's a cultural thing. Japan is, unfortunately, still quite a misogynistic country and it really shows in their school rules. Believe it or not, they
have gotten better. It's apparently fairly rare for a teacher to get out a ruler and measure girls' skirt lengths nowadays, while that was common in the past.
I can understand the nails thing. I don't have any problem with painted nails (beyond the smell of the polish giving me a horrible headache, so I rarely paint my own) but the decorations, especially when there's dangly things on them like Japanese women seem to like, really gives me the creeps for some reason. Like you, it's a very visceral reaction and can make me feel physically ill even from seeing it in pictures. I have no clue why it happens.