Hmph.. Spain realized that they could not keep the United States from talking over the Florida territory so in 1819 Spain agreed to sell Florida to the United States. The Adams- Onis Treaty was approved by Spain and the United States in 1821,They were fearful that the United States would go to war with them and they would lose Florida anyway....
I believe your answer is that The United States threatened to declare war otherwise..
Love, grace..-