Actually companies throw fits when the government contributes to open-source, especially when it comes to lucrative defense related stuff [0].
[0]: https://www.wired.com/2012/07/nsa-accumulo-google-bigtable/
[0]: https://www.wired.com/2012/07/nsa-accumulo-google-bigtable/
> the committee questions whether Accumulo runs afoul of a government policy that prevents federal agencies from building their own software when they have access to commercial alternatives
The law exists to prevent wasting time & money, it has nothing to do with being open source.