Among college-educated professionals, primary and secondary school teachers are near the bottom for intelligence, as measured by SAT scores. https://www.businessinsider.com/heres-the-average-sat-score-...
The pay is shit, so intelligent people decide to pursue other passions instead of teaching.
Also, the profession seems to attract the kind of people who like to exercise arbitrary authority over other people. Not a majority of teachers, but a substantial minority.
Once I realized these things, a lot of negative experiences I had with teachers made more sense. For what it's worth, I also had some great teachers along the way.