Universities are selling a product. As with any merchant, their success is measured by their ability to provide a service that people want at a price they are willing to pay, while making a profit at it.
Diploma mills sell degrees. Universities provide an education and examine degrees. The service they provide is for a much wider community than the students. Even in the US many universities are heavily subsidized by tax payers, and the base of stake holders much wider. The service they provide includes the preservation, creation and transmission of knowledge and these are vital but to the economy and the culture of a country. They also provide a service to employers of producing graduates with some indications in their transcript and references of their suitability for certain types of employment.