Complicated title, but fairly recently a well known exploration company found a sunken Spanish Gold ship. They put their claim in which was later turned over to the Spanish government (back room deal involving some art that I won't go into), but the country in South America where the gold originated from was barred from staking a claim. Why is that, and where do those exclusionary laws come from?
They don't. Found colonial artifacts and structures are generally considered the property of the descendant government. However, the recently discovered wreck of the San José and many other Spanish wrecks contain dead Spanish sailors, whose remains are generally Spanish property and they have claimed the whole site as a war grave. In addition, Spain as a matter of policy claims treasure ships to be military vessels, which are also the property of their originating country (in this case Spain). Most nations agree to the general sentiment of this law because of the importance of recovering sunk or damaged naval assets, even if they don't agree to Spain's specific claims regarding their treasure fleets.