One counter argument: national taxes shouldn't be used to produce code that could benefit other countries, unless that is recognised as a kind of international aid. (Not my opinion, but one I can imagine from certain political quarters)
For example, this is pretty popular political demand here in Germany, as well as in the European Union. (Closely related, almost a special case: that scientific results, especially from public universities, should be open access. And all sources, code as well as collected data, should be openly available.)
It is essentially the same issue as with trading agreements, just a different solution: Instead of waiting for bilateral agreements, here single countries can make a start without having a huge disadvantage.