Universities exist as gatekeepers and credentialing bodies. Their purpose is to certify that a person has studied some topic in depth and is an expert in it. They promote education indirectly, by giving people an incentive to study.
A good university is one where anyone with a degree is guaranteed to be highly knowledgeable in their field of study. This makes it easier for anyone who might want to employ or do research with graduates, as there is no need to test their knowledge.
By this metric, universities have failed spectacularly. This is particularly obvious in computer science. Employers routinely ask CS graduates to solve data structure/algorithm problems in interviews, because a degree is not enough to prove that somebody knows this stuff.
You see this with Physics all the time. Even the people who are sufficiently motivated to try and teach themselves tend to neglect foundational knowledge (especially mathematics, but even stuff like Mechanics and E&M), try to jump into the advanced material (Quantum Quantum Strings Quantum Black Holes Quantum), and then fall into two camps: They either complain about how Physics using too much "jargon", or they read a bunch of "qualitative" pop-sci descriptions of the topic and then think they have an understanding of it.
At least with software, you can get pretty far just learning whatever tool is immediately useful to you, but fully self-taught developers still often end up with random holes in their knowledge.