The universities find compounds that work in cell cultures or mice. They don't currently optimize candidate compounds for use in humans or perform actual human clinical trials. In theory, there's no reason that a government couldn't fund all phases of drug development through final approval and then manufacture new drugs without seeking a profit. But most compounds that work in mice fail in clinical trials, and human testing is a lot more expensive than mouse testing.
There would need to be consistent support for such a drug development program even though most attempts will fail and "breakthrough" drugs will arrive irregularly, separated by many years. It is politically difficult to maintain that sort of long term support in a system where voters and representatives are swayed by short-term arguments to cut programs that don't show results.