There are scarcely any other institutions, parents included, that are capable of teaching children how to read, write, do math, science fundamentals, etc.
We should be dumping 1000x the amount of money we currently are into public schools. Teachers ought to be among the best paid members of the middle class. Yes, schools have their issues, but the solution is to recognize the critical function they serve and the massive underselling of what they could do for us if treated properly as an asset, and to start funding them correctly.
Higher education (for IT and business) is overrated by people who paid so much for their own that they only hire their likes.
Did you? Why not? Myself I didn't.
It's true that the content could theoretically be learned in 1-2 hours a day of studying systematically - if the student is a highly motivated adult with some amount of uninterrupted focus time during the day, and no executive function issues. Children at school are none of this. They're not adults. They're not motivated - or capable of being motivated - by school. They don't have fully developed executive functions. And their parents don't have 1-2 hours a day to spare to homeschool them.
Public school system isn't optimized to help the few ideally-suited children excel - it's optimized to give a chance to grow to everyone. This includes being a daycare, so the parents can work, so the society doesn't break down. This includes giving reliable baseline education to everyone. This includes working as a safe space for children who, due to no fault of their own, were born into poverty, or in pathological families, and would otherwise not have access to proper nutrition and healthcare (this was a big deal during COVID lockdowns). Public school system is, arguably, the only thing enabling any kind of upward mobility in the society.
I think you're right that public education is intended to provide a basic useful level of education to everyone. This is a good goal, though I think many students would benefit from asynchronous (vs. lock-step) study and a less rigid grade structure.
There was a ~30yr period were western society gave it some lip service while backing that up with no reinforcing action. Say 1980-2010 or thereabouts.