You're ignoring that:
-having parents at home, or not working two jobs to make ends meet is linked to wealth
-having parents with good education has a significant impact on how much they can help children
-having parents with wealth means children get a better environment and are more susceptible to focus on work
-...
(Also you're denying the overwhelming evidence of stats and science on this matter)
And teachers benefits outstrip almost any other job. Far more time off, pensions, good healthcare, etc. It's not a problem of what teachers are paid (there is no teacher shortage), it's a problem of how they are managed. Limited competition, degree and seniority driven promotion, tenure, etc.
But again, the best teacher in the world is going to struggle if their kid's parents don't give a crap about working with them at night.