Every country has an interest in ships being safe from arbitrary seizure (or missile strikes).
If that were the case, I can think of numerous other initiatives that would have raised an outcry from them. Instead, Russia and China have both been on the arbitrary-seizure-and-strike support group when it suits them. Which is not wholly unusual in international politics - it only means that when a polity objects after otherwise being quiet on or supportive of a type of action, one should look as to why that is.
That being said, the reasons 'why' are mostly a matter of academic curiosity or political strategy for third parties, considering the US strikes are unjustifiable morally and legally.