By navigating international waters against China's wishes, the US is demonstrating to the international community that China does not control access to those waters. This prevents China from making claims that those waters should no longer be international and instead be China's.
So this isn't the US going off to provoke China (or if you still wish to see it so, at least not for no reason). This is the US exercising rights granted by international treaties in order to prevent China from making effectively false claims to those waters under those same treaties.
That said, I believe your point is valid, but the comparison breaks down once you look at the nuance of the situation. If Mexico feels they can get a better deal by partnering with China to do joint fleet ops in the Gulf of Mexico then I’d say the US has done a very poor job of treating its neighbors correctly, and that needs to be reevaluated. It’s the same answer I have for China - Theyre doing a poor job of being a good neighbor to others in the region.
A more direct answer is that the US is doing the job on behalf of its traditional allies in the region who have claims over parts of the South China Sea which helps to maintain US soft power in the region.
The US navy presence is a reaction to that, and very welcome by almost all of the states on the coast except China, given that without the promise of US opposition, they would all rapidly become members of the Greater Chinese Coprosperity Sphere like Hong Kong and Macao did.
You're misreading your news. The US is doing miliary manuvers in international waters specifically to asser that they are not near the coast of China and are free travel for all. Meanwhile, the Chinese are claiming islands that are no theirs (or building islands out of the sea floor) and putting military installations on those islands. They then claim that as part of China, and trying to assert more ownership of the ocean because of that. The US doing maneuvers near them is a statement that those claims are not recognized.
The British recently did the same thing in waters near Crimea to deny Russia's ownership.
The US has every tight to sail however it wants in international waters, so do the Chinese.
So it would be ok (in theory) to have a warship 25 miles off the coast provided it wasn't fishing or drilling for oil
“But Mr. President, we already have our missiles in Turkey”.
Nowadays those missiles are much closer to Moscow than ever before.
Nevertheless the facts themselves also tend to get reported, e.g.:
https://www.wienerzeitung.at/nachrichten/politik/welt/206683...
https://www.heise.de/tp/features/Deutsche-Fregatte-wird-auf-...
European here, so this may be caused by selective reporting in different regions of the world, but here news is equally often about US military presence in the South China Sea. Looking at a globe and seeing the distance between US homeland and the South China Sea, I wonder who gave the US a mandate for military manoeuvers near the coast of another country? And how this makes China the aggressor?