Relatively (adjusted by area and duration) not that many people from Spain moved to the Americas between 1500 and ~1800, especially compared to the British colonies in North America.
So they couldn't murder/expel (unlike the British/American colonists) most of the native population (especially considering that North America was much less densely inhabited to begin with) if they wanted someone to work in the mines and plantation (again relatively not that many slaves were imported to the mainland colonies as well).
France was similar (except they struggled even more with getting enough people to move to the colonies).