Legally? Going by whose laws? The legitimate owners of all that wealth are the indigenous inhabitants of the territory it was extracted from by invaders. According to indigenous law, it is definitively NOT legally owned by Spain.