Spain did not immediately realize that the New World was in fact a new continent. Columbus himself died without ever knowing that the land he had arrived to was not India.
However, when Spain realized that this land was completely undiscovered, they decided to explore it. This was motivated by several reasons. On the one hand, they were curious to see what the territory was like. On the other hand, they were also motivated by the possibility of owning such a vast territory and the resources located in it. Finally, they were motivated by the idea of turning the Native American people they encountered into Christians, thus achieving their salvation.