Screw that court and screw Spain. If Spain wants the ill-gotten gain from its colonial period off the ocean floor, it can pay to do it. They hadn’t lifted a finger in the subsequent centuries — just as during their colonial heyday, they’ll rob whomever they like.
The practical solution is to go to the Spaniards before any salvage is attempted and cut a deal to share what is recovered. I agree it sucks in this case the Spaniards took it all.