Unsurprisingly, both of these "jobs" cost money. Education needs teachers, research needs researchers, and both need administrative support staff. Buildings and other infrastructure need to be maintained, and many other small and large costs accrue. Sadly, neither of these "jobs" actually generates substantial money directly - in Sweden education is free (students pay no tuition, even at our private university), and with the exception of the rare patent- or spinoff-generating research, even world-class publications do not pay salaries or utility bills. At Chalmers, just like at most universities (at least in Europe), all our core functions are substantial loss leaders.
Hence, Chalmers needs income streams. The government pays us for graduating students, which is sufficient (more or less) to cover the "education job" at least on bachelor and master level.
This sounds suspiciously like the conflict-of-interest that is regularly levelled at open access publishing - publish more papers (even if they're terrible), get more revenue; graduate more students (even if they're terrible), get more revenue.
How does the government prevent this conflict of interest from turning universities into "predatory universities"?
I'm tagging this question with
sweden, although it should also apply to other countries that pay universities for graduating students (are there such other countries?).