The USG spent $6B on cloud computing in 2020. That number is increasing quickly. To say nothing of the massive quantities of non-OSS software that the government buys and incorporates into is own business-critical processes. And it's not just government licenses, but also anyone who interacts with the government. E.g., try interacting with any government agency without an Office 365 license.
You get really funny looks if you say that MSFT should have to give away Office 365 for free if the government is going to use it for anything.
But total USG spend on closed-source software has to be well into the 30B-50B range conservatively. For reference, the entire NSF budget is $10B.
The main reason for this is that there are many monied and powerful stakeholders who benefit from selling closed software to USG, whereas the academic publishers a tiny, often not even American-owned, and got super greedy and screwed their natural contingency (academics hate them as much as or more than anyone else).