They basically are cancelling the contract, but there are some nuances on Anthropic's side. The contract probably has stipulations that prevent them from doing it overnight, so it might be illegal (but ethical) for them to just turn off the API keys.

Also, doing that might have bad second order effects with bad ethical implications.

For example, when Musk decided to pull the plug on a bunch of starlink terminals, he (intentionally and knowingly) blocked a US-funded attack that would have sunk a big chunk of the Russian navy, which certainly prolonged the Ukraine war. That was clearly an act of treason (illegal).

Anyway, just turning off Claude could kill a bunch of civilians in the region or something. It depends on how deeply it's integrated into military logistics at this point.

Anyway, your point certainly holds for OpenAI:

They walked into a "use ChatGPT for war crimes, and illegal domestic surveillance / 'law enforcement'" deal with open eyes, and pretty obviously lied about it while the deal was being signed. I don't see any ethical nuance that would even partially excuse their actions.