“Admiralty Law”, naval ships are owned in perpetuity by the country under which they sailed.
Seek,search,shut up.
Except when naval ships, and their Captains, are carrying private freight for which they are paid for the service. Most of this treasure was not Spanish Royal Treasure, but was private treasure owned by Spanish entrepreneurs and officials. This treasure was subject to seizure by salvors, but the lazy American judges who couldn't be bothered to research 19th Century Admiralty law made an incorrect judgment.