Being poor is simply a lack of resources and opportunity. A rich kid in a poor school will still have access to the same opportunities as a rich kid in a private school...
Parental wealth only matters if the parents are willing to spend on the kid. A "rich" kid in a poor school probably doesn't have parents who care to help the kid, making the parents money moot.
Or they are parents who believe in supporting the public school system, even at the expense of their kid.