500 years under the water is a long time, but that doesn't mean that it doesn't still belong to someone. I think that if treasure is recovered, regardless of land or sea, the country of origin should have first claim to that treasure after the discovery expenses are deducted. If the country of origin no longer exists, then the treasure should go to whomever discovered it. That's the moral perspective. But let's be honest, most people are more about "Finder's Keepers, Loser's Weepers!" instead.
No, Portugal should not have waived her right to the treasure found on board the ship. If the treasure belonged to Portugal then the country has a right to it. Even if the ship wrecked 500 years ago,no one else has a higher claim to it. Portugal should keep the treasure.
The old argument possession in nine-tenths of the law applies here. Despite the shipwreck being 500 years old, Portugal has claim to it and the treasure that is on board. To waive their rights to the treasure is to waive their right to history. The treasure should go to them but they should take the treasure on tour so that other cultures can enjoy it.
Portugal has the right to keep any and all treasure found on board the 500-year-old shipwreck because it was found in Portugal. If it was found in another country, they would lay claim to the treasure. It is up to Portugal to decide what they will do with the treasure, whether they will donate it to museums or sell it.