If you have to teach the kids who need help, you get poor marks when some of them inevitably fail.
Edit: why the downvotes? If you are uncertain of or unamenable to the way outcomes are measured, vouchers are a reasonable solution that puts the power in your hands
An extremely significant part of how parents choose schools is based on the social groups they want their kids associating with.
99% of the academic success of private schools is attributable to their ability to exclude poorly performing students, not some magical pedagogical secret.
It’s the same exact reason why homes of equivalent quality in two different districts of the same school system may have 2x or 3x price differentials. Because parents pay hundreds of thousands so their kid doesn’t sit next to a kid with parents who can’t afford the same.
If schools are unwilling or unable to provide a stable learning environment then parents move on. There has been a lot of ink spilled on exactly why this is, including the racial and religious issues you allude to, but the brute fact is that in many communities families flee or switch to religious school because their children suffer violence at the hands of their fellow students.
IMO this entire problem was caused by segregating our schools to begin with. The problem of misbehaving kids isn't going to be fixed by giving them free vacation on the streets. They need to see with their own eyes that their behavior isn't acceptable, and that means putting them in environments where they are outsiders. Kids are a product of their social environment, full stop.