One of the initial proponents of public education in America, Horace Mann, saw education in a two pronged manner.
First, a functional democracy requires that the citizenship be well informed and capable of critical thinking: "A republican form of government, without intelligence in the people, must be, on a vast scale, what a mad-house, without superintendent or keepers, would be on a small one."
He also saw the economic side, saying that education was an equalizer for people in terms of helping them to reach their full potential.
I quite agree with his assessment. In a system where everyone has a vote, it becomes quite important that everyone have a sense of things that extends beyond their career vocation. His imagery of an uneducated republic being a madhouse makes much sense from this perspective.
Insofar as we have given up any optimism about the democratic enterprise, then certainly we could look at education as purely to put people into economic bins, but at least in my own public school education in the US, every student did get significant doses of math, history, science, etc., outside of their expected career direction.
This to me suggests that there is a tension, not fully resolved and HOPEFULLY never fully resolved, between education-for-economics and education-for-democracy. I think it's quite pessimistic though to give up the ghost on the education-for-democracy aspect.