Teachers only need minimal knowledge of their subject, and if someone discovers that they don't actually like teaching then they just keep doing it anyway because they got a teaching degree, and can't do much else with it.
Some possible ways to help: give teachers less class time and more time to prepare interesting lessons, pay teachers more, raise the standards of training and hiring.
See http://www.statisticbrain.com/iq-estimates-by-intended-colle... and note that, relative to other college majors, education majors tend to be dumb.
I also know a number who came from a humanities background, and "learned enough math" in the single, poorly taught math-for-teaching class they had in getting a masters.
One of these groups makes better teachers (and likely has a wider career path, because of the undergraduate degree).