Just because it’s impossible to make all the schools better, doesn’t mean people have to be stuck in their social-economic wrung without an easier way to advance through education.
Your abilities to advance through education are limited by your genetics. If you have good genetics, chances are, you already live in an upper-middle-class neighborhood with good schools. If, by some fluke of nature, you’re a bright kid born to white-trash janitor parents, there are magnet schools (Preuss), GATE programs, etc. So, you’re not entirely on your own.
In the perfect world, all children would be segregated by their learning capabilities. So you won’t have a situation where bright kids are bored because they are not challenged enough, and not-so-bright kids aren’t getting proper education because the class as a whole moves too fast for them. The existing scheme where children are segregated by parents’ incomes is not perfect, but it is a big step in the right direction.