The school district I worked in had impoverished students but high per pupil funding, which is pretty common. What reinforced the inequality in that district was that teachers who were able to, self-selected to have the best behaved students, who were most likely to see improvements in test scores. The teachers who ended up with 90% of their students starting the year multiple grade levels behind and with severe behavioral problems would rarely stay in the classroom more than 2 years.
You think of it in terms of inequality, which is one perspective. However, if seen from the perspective of the best behaved students, the ones who want a positive learning environment that will maximize their talents and success, this situation seems greatly preferable to the alternative, which is a sprinkling of problematic students disrupting the learning equally in all classrooms and making overall outcomes more mediocre. This is Ontario's public school system lately, in a nutshell.