I work in medical research and mostly agree with this, but there are two major problems I see preventing this from becoming a reality:
1) Academic medical research is simply not well tooled, right now, to do the later stages of drug development. What pharma does well and academia does not, is basically optimization of candidates. They do it through high-throughput screens and medicinal chemistry. Those things are very expensive and not publishable, so...academics don't do them. And everyone with the expertise works in pharma.
2) Clinical trials are freaking expensive. My institute has developed several drug candidates and the same process necessarily applies every time. The public-funded researcher basically HAS to either sell the patent to pharma or start a company and raise the many millions required to do a trial. The amount of money required is way out of range of current grant funding. If they want to see their drug get to patients, and of course they do, there is literally no other way right now except partnering with pharma.
When I get a chance to talk to politicians about how to fix this, I always make the same pitch. Step #1 should be to give a huge wad of money to the FDA. Say $1B/yr. Then you tell the FDA: every year, pick the 50 most promising drug candidates. Publicly fund the clinical trials, and the public will own the patent. Give some cash to the inventor and the institute to incentivize them to do this scheme and not sell to pharma.
Politicians, both left and right, look at me like I'm from Mars when I propose this. Those on the left think high drug costs are all about greed and not our broken system, and those on the right have unwavering faith that "free" markets will always solve everything.
And with insulin specifically, there is another problem: diabetics won't take the generic insulin that has been off-patent for years now. They must have the fancy and more convenient version. Mark my words, the fact that Americans must always have the absolute best thing, cost be damned, will become a major issue if we ever get single-payer.