The best way to prevent a private entity patenting an invention and monopolising it themselves, is to patent it first. Proving prior art is notoriously difficult and patent reviewers frequently overlook even obvious examples, but pre-existing patents are impossible to ignore. So the government patents them to preserve broad access to the invention.
> So the government patents them to preserve broad access to the invention.
I would assume or at like to believe this is true with federal government patents, but it's not true for state governments, government-funded universities, etc. It would be nice to have a law or official policy to point to that states outright that the federal government can't or won't sue anyone for using the technology in those patents (or the opposite).