That law does not apply to naval vessels, who possess soverign immunity and cannot be salvaged except by permission of the soverign state owning the vessel. Their is an exception for the private cargo that might be carried by naval vessels. That's what this suit is all about, and the judge seems to be ignoring the historic fact that most of the cargo was privately held and being carried as freight by the Spanish Navy.
This vessel was being used as a cargo ship and is therefore not granted immunity. The judge is wrong in this case. There have been precedents of this nature before and the ruling was if the ship in question was acting as a cargo ship at the time it sunk, it was not considered a war ship.