Not separating into inherently deserving and undeserving, but those who desire a good education and those who do not. There are students in poor schools who push to become learned in spite of obstacles. Think Ben Carson for an example. And there are those who have tons of resources and opportunities but fail to use them, those who don't care about learning something. I knew quite a few of the former, people who would go to the library for extra study or to learn things after school. And I knew quite a few of the latter, who would go home and play video games or go out and drink, who didn't care about learning anything.
In today's school system, the resources go to those who do not desire an education. This is because of programs like "no child left behind", and because a higher graduation rate looks better. But I think we should make a normative judgement that those who do not make an effort to better themselves should receive no support from society. Put less money into summer schools for kids who fail, and put more money into before- and after-school tutoring. This will benefit those who put in the effort to the detriment of those who don't care, which is a good trade-off.