It’s a shame but some children will need to be institutionalized for their schooling.
We need orphanages, too, but no one is claiming it is the best or most natural way to rear a child.
Somewhere north of 85% of American kids are put in government institutions. Many of whom put there by parents who know better and can afford better. We aren’t going to fix that, but we can nibble around the edges with private schools, charity, and home education.