This is a good point, but I think you can reduce the effect of bad parents by having better teachers. If you didn’t have a teacher that changed the way you look at life (for the better) you didn’t have good enough teachers.
They may be paid less, however they are the best teachers. They do it because they love to teach, at least in my experience. Religious schools might not have a lot of resources, the private schools (non-religious) I went to certainly had the best tech, etc…