My brother had a high-school math teacher who could only explain "the reason we say the square root of 2 is irrational is because it says so on page 79". I had a physics teacher who marked an answer wrong on my exam because she didn't know how to do the problem.
Most every one of us has an experience like this, but it's also seeing the teachers at one of their -3σ moments and focusing on that. If you looked at my -3σ coding results or personal decisions, you'd probably conclude I was a mouth-breathing idiot as well. (I would expect an Algebra II teacher to be able to explain what a rational and irrational number meant, though.)
I doubt that the pay of teachers can be raised sufficiently to fundamentally change the makeup of people in the profession. It's just too many people and too expensive to change from any amount of pay difference that the taxpaying public could sustain. There are some great teachers. There are many good teachers. There are millions and millions of completely unexceptional teachers.