Try putting up with 30+ children and looking calm, clean and collected by 3.30pm every day... and then working through the evening to get things done... and then you'll see why there are unkempt teachers!
It's very unpleasant to judge people on their appearances. As someone who got bullied a lot at school for my appearance (i.e. something that couldn't be helped at the time), and had to put up with several judgemental relatives, I learnt to hate myself. Interestingly, people treated me much more nicely when the main problem with my appearance was fixed. However, that didn't stop their comments on other areas of my appearance. I'm not the kind of person who has sleek, shiny hair, or perfect skin, but I'm still a human being with feelings that are just as valid as anyone else's.
Even now, I get treated very differently based on what I'm wearing (i.e. looked down on for my work clothes, but treated with deference and respect if I dare to step out in a skirt or a smart coat). Throw in my accent or my name, and that throws other curveballs.
Some of the kindest people in this world dress down, or have unusual accents, names or mannerisms. Some of the nastier people might look nice, but it doesn't make them a better person.
As a result, I try to look past what's on the outside. It's what's on the inside that matters most. Perhaps, if everyone tried to do that, the world would be a much nicer and kinder place to live in.