A debatable point. A purchase at gunpoint isn’t exactly freely consented to. Also it’s certainly debatable whether $15M was a fair price.
This is of course how most wars ended. One side marched into the capital of the other and imposed terms.
IOW, we acquired title exactly the same way the Indians, Spanish and Mexicans did, by force.
Sucks to be a loser.
To the victor go the spoils.
BTW, the $15 MIL was in gold.