If they sell 100% of their shares to the VCs, the VCs have 100% ownership of the code, because they own the company.
By contrast, public funding for code is buying code (at least in theory).
Take Windows desktop. It's designed to run at scale, out the box, when you have 10 000 employees, and any hardware, printers, whatever. A govt isn't buying Windows its buying active directory, and the fact that every new hire knows how to use it already. And a million other things windows does at scale (technically and humanally).
Funding developers is a risk as to weather the results will be what you hope. Paying for software is actually paying rent on something already complete. A typical software company uses the rent they collect on prior work to fund the newer risky work. The big companies are mostly doing the rent thing to pay shareholders.
Labor needs to be rewarded, not just investment capital.