To be clear, abuse in these programs should be prevented as much as feasible, and there should be an opportunity for any kid who demonstrates redemption to get back in school.
It’s a bad solution, but I don’t know any which is better. Keeping them in society is worse for innocent people (and doesn’t seem to usually benefit them either, misbehaving kids usually seem miserable).
And yes, the state pays to take care of them. Otherwise it’s paying for the damage they cause outside.