I think a lot depends on the child, the school and the parents.
Plenty of people have a terrible time at day schools, whether state or private. It's certainly not something only boarding schools experience.
Not all parents are nurturing, loving and supportive. Yes, they should be, but they aren't. Some parents are absent, whether through desertion, work, death, alcoholism, ill health - all sorts of reasons.
Different schools have different cultures. Even different boarding houses can have different cultures within a school. So a child who gets on well at one school may not fit well in another.
Decisions aren't just made about the children's needs,though. They're also made about the parents, about family tradition - there are schools with generations of - mostly boys,to be fair, - from the same family. I doubt there's much consideration there if it's really the best place for a particular child. Money is a big factor, too. It's not a cheap option,especially if you don't get any scholarship or bursary.
I've a friend who is pastoral lead at a top school, boarding from year 9. He does it partly because his own experiences at public school means he is very determined to not have any children experiencing what he did. He can only do so much, though - the new overseas students with homesickness who don't get to go home on exeat weekends etc - they do their best to keep them entertained when the rest of school has cleared out, but you can't change the fact they're a very long way from their parents.
My father boarded from 7. As far as I'm aware, he enjoyed it. We met people he'd been at school with (some as godparents.) He seemed much more sorted emotionally than my mother who was entirely state educated in day schools.
It's definitely not for everyone, but some people thrive, and I wouldn't ban it.