I believe government transparency is vital to a functioning society. It is what makes governments accountable for their actions, including mass surveillance, military technology, and other activities conducted in the public's name. If taxpayers fund the development of software, they should generally have the right to inspect its source code. Open-source code allows the public, researchers, and independent experts to examine how government-funded systems work, identify potential abuses, and hold governments accountable.
There is, however, a legitimate concern that releasing sensitive code could create risks for national security. The development of the atomic bomb demonstrates that technological competition can create dangers even when governments attempt to maintain secrecy. When the Soviet Union developed its own atomic bomb in 1949, the United States lost its nuclear monopoly, intensifying the fear of mutual destruction.
Nevertheless, government-funded code does not necessarily mean government-owned or government-controlled code. A company such as Palantir, for example, can receive government funding without its entire codebase becoming government code. The important question is whether software developed with public money should be open-source, and whether any exceptions are justified by genuine security concerns rather than a desire to avoid scrutiny.