Schools are just a place for warehousing kids; even people who take no interest in education know this from personal experience back from when they were a kid.
Exactly 0 of 627 college students can answer simple questions like 'What is the name of the mountain range that separates Europe from Asia?' or 'What is the last name of the author of The Brothers Karamazov?'.
https://www.forbes.com/sites/jamesmarshallcrotty/2013/09/10/...
The striking thing is that the dismal career prospects hasn't stopped bright ambitious people trying to get into academia. Whereas In Australia you can just look at entry-scores for teaching degrees to see that only people who did poorly in school go into teaching nowadays.
So sure, pay and conditions have some influence but it's not a sufficient condition to explain what's happened in teaching. Pretty sure if researchers could get the job security and entitlements of teachers we'd have no problem finding bright people trying to get into research. But that's because research is more intrinsically rewarding and higher status.
Child-minding just fundamentally isn't a job which requires much talent, the job is steadily degrading to the status and pay which one would expect for a semi-skilled occupation. The teachers' unions are doing a valiant job fighting a rear-guard action to prevent that decline, through rampant credentialism to buttress the 'professional' status of the job. But it's an uphill fight, politicians aren't going to push for tax hikes to fund teacher salaries when every voter knows full-well that regardless they're still going to have to teach their kids themselves or get tutoring if they want their kid to actually learn anything.