My guess would be that poorer schools spend their funding on meals for students and other basic necessities, whereas richer districts can allocate their funding to better programming and facilities, etc. Test scores are however more a result of parenting: attention to kids’ needs, stability in the home, etc. Kids in poorer schools face a lot of challenges outside the classroom that affect their ability to learn.