I tuned out to those the moment I got to middle school and realized that I did not have to write all my assignments in pen, use cursive, or risk having my assignment shredded if I forgot to put my name on it.
Being an authoritarian asshole is probably a coping mechanism for teachers who struggle to navigate the same hellscape the students must. Teachers aren't immune from the school yard popularity contest: the charismatic teachers seem to have a much easier life than the rest.
I found it was usually older teachers who were authoritarian luddites. I don't think it was a coping mechanism, I just think that's how they genuinely thought the "real world" still works, as they had been teaching for 40 years and had no idea what non-teaching jobs and university were actually like.
Maybe those who teach secondary school do so because they have difficulty handling the real world.
* I both work as a full time developer at a fortune 100 company and teach a few sections of a college level programming class each semester. So I don’t know what this says about me.
The scary distant Real World turned out to be much easier to handle than the artificial one behind the walls of the schoolyard.
And to wit, by all objective measures, I ended up "handling" the Real World far better than any of the people who told me I wouldn't.