Depending on what you mean by "school" I'd disagree. Voluntary tertiary education makes sense, not all chosen professions may need or benefit from a degree.
But primary education needs to be a requirement for every child. Coming from a country with a large illiterate population, it's easy to see how hard their lives are compared to folks with an education but similar socio-economic backgrounds.
Now obviously implementing universal primary education and the details can be debated and need to be context specific.
Problem is when one mixes kids who don’t want to be there with one’s that do, they all suffer.
Makes a lot of teacher not want to be there too!
The schools also have little interest in spending time and money on the higher performing students. They teach the minimum and focus resources on the failing ones to raise school averages.
Currently, tertiary education is where a lot of real learning takes starts to happen.