Pilots used to be highly paid, but their unions have been broken, so now they are not highly paid anymore. Their unions were broken through a series of corporate bankruptcies. Basically, management was able to get out of any contract they signed through strategic bankruptcies.
Meanwhile teachers used to be one of the few fields an intelligent, educated woman could easily work in. Women had a choice of being teachers, nurses, or secretaries. Sure some could do more, but it was difficult. When half the population is forced into a few fields, you can massively underpay them. That has chanced. Women can do whatever they want, so we would have to pay teachers better to get good teachers.
Somewhere along the line, Republicans have decided they can fire their way to good teachers. There is a shortage of teachers, so firing a bunch of teachers is counter productive. The few teachers that do get fired by management are usually the best teachers, because they make the rest look bad. Management is usually very happy to hold on to the worst teachers, because at least they fill seats, which in a teacher shortage is the most important metric used.
If we raised salaries, and respect for teachers, then competition would raise the quality of teachers. That is Finland's strategy. They made teacher a well paid, well respected career, and now only the best become teachers. They do not bother with a lot of testing, but still are among the top education systems in the world.