Assume the underlying cause of the discrepency is external to the school (eg. parents' income) (yes, this is an assumption that may not be universally true). It is possible that throwing money at the schools still helps, but just not enough to counter the original difference (either because we aren't throughing enough money at the problem, or we are out of productive places to through money).
For instance, consider providing 3 free hot meals a day to students. This helps poor students far more then wealthy ones, and is something we can "just through money at" (nothing in large orgs is actually that simple, doubly so in goverment). But it will not close the gap entirely.
Schools with more special needs (In the literal sense) students will perform worse on standardized tests. They also need bigger budgets, because they need more staff, to support those special needs students.
Schools with more students coming from troubled homes will perform worse on standardized tests (Because not only do those students score badly, many of them disrupt their classes, causing problems for other students.) The common solutions are smaller class sizes, more administrative staff, more money spent on dealing with damage to school property, more money spent on on-site security, etc.
Being a teacher to 30 kids is hard. Being a teacher to 30 kids, and a parent to 10, and a cop to 5 is maddening.
These school districts that are spending more money, and performing poorly... Usually aren't pissing it away on serving caviar on Thursdays, and filet mignon on Fridays in the cafeteria, or on sending the Grade 5 class to Disneyland, or on buying the principal a Porche.
[0] http://journals.sagepub.com/doi/abs/10.1177/0022219476009009...