But there's 2 problems with that. To save money governments declare that "teaching is a profession". By which they mean: "teaching", not subject matter expertise, matters. Except:
1) the single thing you cannot beat is capable teachers. And NOT capable as in able to teach, subject-matter-experts. And that is what everybody wants to avoid at all costs.
Put it like this: an unwashed, abrasive, offensive smelly asshole with a master in math can teach kids math. A super-friendly, nice, beautiful, polite social science major (or not even that) who doesn't know math well cannot. The level of teachers needs to be an order of magnitude above the level expected of kids at the end of the class. Knowledge of the subject needs to take absolute precedence in teacher hiring decisions, to the point that good teachers get rejected if lacking expertise in the subject.
This is not how things work. They only worked that way for a short while due to the crash of 89. I've had a French teacher that couldn't speak more than "some" French. Certainly nowhere near fluent.
2) Money needs to support that. Which means for Math, the money for math teachers needs to be competitive with research departments of banks, and very different for different subjects, which seems offensive to schools and government in general. If teaching positions aren't competing with other professional careers in the subject matter, it will never work. This will, of course, mean that many science teachers make more than a school principal and even a district administrator. Deal with it.
For Math, they are literally not even 25% of that, but even for French it's insufficient.