From the outset the arrangement was unethical because the government is renting software rather than owning it, which means having full rights to understand, maintain, and modify the source code
Unless they have a unique arrangement, the software is licensed for use, not rented. Also, if the covernment want it, they may have access to the source code. There have been (and I assume there are) programs for giving large customers access to the source code under NDA. Whether this would give them rights to modify the code is an issue, and even more of an issue is if the government are able to set up an entity which are competent to actually fix the code. Do you think they are? Because if they are not, then why have the code in the first place?