> If the government wants to add a small change to the tax code [...] they'd have to hire the same company that wrote it
This is a very strange statement and you probably have some specific situation in mind that isn't really representative.
Normally when you hire people to write your code they do a work for hire, unless your contract says otherwise, you own the rights. There are some minor exceptions, typically for countries that treat commercial and artistic copyright differently, but that's it. I've been hired to add changes to people's software thousands of times, and it's never been on the table that I get some kind of ownership of their source code.
The license said source code is under is completely irrelevant. Especially in this question of tax authorities. That source code is normally not under some public license at all because it's their internal processes anyway, they may change at any time and the employ a number of programmers to do so. Plus a handful of consultants.