what makes them act that way is the power of their position. i dont think these people got to where they are by being assholes, because guess what would happen if YOU did that? yeah you'd be looking for a job.
it's the power, real or imagined, that does this to people. it's why i refuse to managerial positions. i've only known like two bosses who were no different than when they were just regular worker.
ever seen waiting...? in the movie the manager makes a comment about the perks of being in management and one was "you get to tell them what to do, and they have to do it!" they put that in there to display the mindset with some bosses.
i do think it applies to teachers, they are in a position over the students, the teacher sets rules for their classroom, the kids in their classroom, etc. and i've seen the same thing with teacher, some just abuse that power. though i always see at least one example where a teacher, a boss, a cop, etc, that does not do this.
this doesnt include those who just arent suited for the job, whatever that job may be, which is a different discussion i think.