I thought that too but this article [0] with really good graphics shows how the federal and state government give out funding selectively to counteract that such that 47 states actually allocate more per-student funding to poor kids than to nonpoor kids and according to the article, it has been this way since at least 1995.
[0]: https://apps.urban.org/features/school-funding-do-poor-kids-...