The search for spices led to global exploration because the people of Europe really wanted to find ways to access spices directly. They wanted to be able to get to the places where spices grew so they could buy the spices themselves instead of having to pay other people to bring the spices to Europe.
In those days, spices came almost exclusively from what is now Indonesia and the surrounding area. This was far from Europe and so Europeans could not buy spices directly. Instead, they had to buy them from merchants in the Middle East who brought the spices to Mediterranean ports.
The search for spices led first to the exploration of Africa. Europeans wanted to see if they could sail south, get around Africa, and then sail east to Indonesia. After that, the search for spices led to the exploration of the New World. This was an accident, but it still happened because of the search for spices. Columbus wanted to sail west to get to Indonesia because he thought the world was smaller than it is and that he would not have far to go to get there. He did not realize the world was so big that there could be a continent and a huge ocean between the Atlantic and Indonesia. Once the New World was found, people explored for spices, but also for ways to get around it and get to Asia.
Thus, the search for a way to access spices led Europeans to explore the coast of Africa and then to explore the New World.