Spain loomed as the dominant power of Western Europe throughout the sixteenth century. A significant part of its power is closely tied with its empire in the Americas and the vast amounts of treasure that would be shipped back to Spain, but it is important to note that the New World Empire amounted to at best around ten percent of the monarchy's income (Merriman, 173). While still a significant contribution fully on its own, we'll have to look further afield than simply the Americas to explain this global power.
One thing to keep in mind: Empires in the Early Modern Period were not nation-states as we know them today, and Spain as it looked in the sixteenth century was a very different entity than the modern day polity of Spain. Perhaps most importantly, it was dynastic. The Spanish Empire was first and foremost the imperial holdings, first of the Trastámaras and later the Spanish Hapsburgs, and Spain itself was created out of the union of the kingdoms of Aragon and Castile under Ferdinand and Isabella. If we look at the peak of Spanish power under Philip II, we'd see an empire that comprises modern day Spain, but also controls the Netherlands and large portions of Southern Italy. Even if we leave out the New World Empire, Continental Spain still sufficed to be a significant political power on its own merits.
However, the Spanish Empire did have its weaknesses which eventually contributed to its decline. Perhaps most obvious was the strong religious devotionalism that characterized the Spanish crown. It should be noted that one can argue that this devotionalism was critical to Spain's rise to power as well: the nation was forged in the Reconquista after all, and as we can see with the Spanish Inquisition (which was headed by the monarchy rather than the Papacy), religion was often used as a weapon of the State to serve its own political interests. However, it contributed to the dissolution of the Spanish Empire as well. Ultimately, Spain's attempt to suppress Dutch Protestants resulted in the Dutch Revolt, which represented a critical loss to the Empire. In addition, we can add the heavy losses sustained in the Thirty Years's War (the last of the great religious wars) from which Spain would never fully recover. The Early Modern Era was one dominated by religion and by the military struggle between different religious groups (Christians vs. Muslims, Catholics vs. Protestants) and the Spanish were in the center of that story of conflict, ultimately to their detriment.
Since we already mentioned religion, we might also mention dynastic struggles, which also played into this same pattern and can sometimes be difficult to fully separate from religious devotionalism. Regardless, the numerous wars Spain fought throughout the Early Modern Era drained away much of its economic and military strength and in the end proved crippling in effect.
For a deeper, more comprehensive explanation of the rise of Spanish power, see John Merriman, A History of Modern Europe: From the Renaissance to the Present (Third Edition). New York: W. W. Norton, 2010. Chapter 5: pp. 171-178