It was always a nursery + learn basic skills like reading and math + creating habits like showing up on time (creating effective factory workers while their parents work in a factory).
Later we added an extra level that prepares for higher education, and here all you are doing is jockeying for a spot in university. Cramming details for a big test so you can be graded vs you peers when applying for university. That's the whole point really. Was majority of knowledge gained in secondary school is lost by the end of your 1st year of university.
The whole idea of school being a place that inspires young people is romanticized propaganda.
At best a teacher might pick a student or two that shows promise and guide them a bit. But they can do it for all kids in every class. They cannot make physics interesting for all kids and make them get all 100% at final test.