Technically an attack on a ship registered through the Marshall Islands is an attack on the Marshall Islands. Just as an attack on a NATO vessel is an attack on NATO. Which we also have a treaty to protect.
Oh for God's sake, the Marshall Islands is a flag of convenience. They will allow any company to register any ship they want under their flag and in return they offer a haven from taxes and regulations. The ships in question never come near the country, do not have any Marshall Island citizens on board, and the Marshall Islands itself couldn't care less what happens to them. And you want to go to war over it.