The morality argument here considers countries (defined as government + population) as actors, rather than governments. So the question is rather whether it's immoral for the people who elect a government to demand that it represents solely their interests to the point of sacrificing other people.
That’s not what is happening if it is a tragedy of the commons.
Maybe, in the sense that it could be politically destabilizing or something like that.