I'm not sure it would be in the taxpayers' interest to make it easier for private and/or foreign competition against their investment
Suppose I found a way to make synthetic oil for 1$ per barrel from atmospheric CO2 and published it. Now I can’t capture that wealth and Exxon’s and many other companies stock tanks so it looks like global wealth decreased. However, soon everyone across the globe can now buy more with their money. Lowered transportation costs for potatoes means potatoes cost less in a very real way.
This is why patents expire, everyone gets richer when they do.
Funnily enough that's part of the plot of Metal Gear 2: https://metalgear.fandom.com/wiki/OILIX
Of course, a successful business will pay taxes and increase economic activity etc. etc., but I don't think that's much of an argument. It absolutely is strange to see government-funded research ending up locked down like this, if that's what it is.
let's say the patent is released, and a year later every household in the world is thrilled to have black morels every night for dinner, for free, out of their DIY morel cultivation box, and nobody anywhere in the world can ever sell a morel to anyone else again.
Have "the taxpayers" seen benefit from this? In terms of currency return on investment, no. But in terms of access to a desirable commodity, heck yes. How much value have they seen? Something like 365 times the price of a meal's worth of mushrooms.
The best government research generates benefits this broad.