I had a big discussion with 4 guys about the historical purpose of universities. Why they were created and what the primary goal was.
I said that they where created for people to get an education to find work. To be able to be a needed citizen in a big complicated society. But they were all certain that universities were only created for young rich people because these aristocrats wanted to learn for the learning itself as they already had all the money they needed. They actually got really irritated with me and called me ignorant. So, what is the real answer?
They were created to train people to work in royal courts.
Education was centered in cathedral schools in the eleventh and early twelfth centuries. These schools were ostensibly intended to train the clergy and were run by the church. But many of the clergy were also heavily involved in politics, so this religious education was doing double duty as preparatory training for government officials who needed a liberal arts education to prepare them to meet monarchs' need for literate officials.
The entanglement of church officials and secular governments led to tensions betweem the papacy and several monarchs, however, culminating in the excommunication of the Holy Roman emperor in what came to be called the Investiture Controversy. The result of this conflict was that the church no longer wanted its clergy serving at the whim of local governments - they should focus on their religious calling without interference from secular authorities. That meant that the cathedral schools would no longer be training aspiring government workers, however, so royal courts need a new way to educate officials for public service. Universities grew out of that need for a new, secular educational system.
And yes, the university students were generally rich. But they didn't just get an education to satisfy their curiosity - it helped to prepare them to fill positions in government that required a liberal arts education.
But these jobs were highly specialized, and a university education wouldn't have been necessary for most of the population. Craftsmen would have learned their trade from other craftsmen theough apprenticeships, and most people were peasant farmers. It's not like today where a university education is required for social monility - most medieval people didn't have much chance of social mobility, and the few that did moved up the ladder through commerce, not by saving pennies and going to a good school.