The Spanish earned it because they had the technology to extract it.
And the whips and guns, because *THAT* is how it got dug out of the ground. The Spanish were absolutely evil in getting that gold. You think slavery was bad here? Spanish slavery was far worse than anything ever done in the US.