Why is spain so much weaker than France, Britain, Germany And Italy? Historically they have great wealth, agriculture and trade with america that speak their language, and they have the mouth to the mediterranean.
Where did they fall short, and when?
To quote Bismarck: ‘I am firmly convinced that Spain is the strongest country of the world. Century after century trying to destroy herself and still no success.’
Spain's great Empire starts in the 16th century with vast colonisation of the Americas. They found a vast amount of resources here, new and old. One of these resources, which they found in great amounts, was silver. Spain would import a lot of silver into Europe.
However, in 1492, Spain had not only expelled the Emirate of Granada from its soil, they had also expelled the Jews. The Jews, as it were, made up the majority of the Spanish banking system. Spain was now importing a lot of silver, and due to economical mismanagement, Spain would see inflation. By the end of the 16th century, prices had rose 6 times what it should have been. This financially ruined the Spanish crown.
Ofcourse, this was not the only part of Spain's problems: warfare and rebellion would also consume a lot of their efforts and finances. Spain would war many times with the English and the French, both in the colonies and in the mainland. Furthermore, the Dutch rebellions also consumed a lot of effort from the Spanish.
Spain essentially mismanaged their Empire, and started sending it into slow ruin. Fast-forwarding to the 19th century, the American colonies began having nationalist movements. During the Napoleonic conquest of Spain, Napoleon would put his brother (José I of Spain) on the throne. This wasn't very liked by the Spanish, and furthermore, the colonials saw this as an opportunity to proclaim independence, facilitated by the fact that the British were blockading any attempts by Spain to suppress rebellion in the Americas. All of mainland America was now independent from Spain, and Spain only held small insular colonies in the Americas and the Pacific. Then, in 1833, Fernando VII would die without a male heir. He cancelled the Salic Law to name his daughter heir apparent. This wasn't appreciated by his brother Carlos, who thought himself the true heir (and indeed he was until the Salic Law was repealed). Over the 19th century this would cause three civil wars (Carlist Wars) which put an already weakened Spain into a lot of turmoil. Furthermore, failed attempts to become a Republic (1871) or trying out a new monarchy (Amadeus I of Savoy) also destabilised Spain in the 1870s. From this point, until 1903, Spain's politics would be highly corrupt, with two parties alternating incumbency illegally, with high amounts of repression within the country.
As a final blow to the dying Spanish Empire, the Cuban crisis of the 1890s culminated in a war with the USA, who decided to intervene for Cuban interests. Spain would give Puerto Rico, Guam and the Philippines to the USA, and release Cuba as an American protectorate. The last few Pacific Islands that Spain held they would sell to the German Empire within the year, effectively ending the Spanish Empire but for parts of Morocco and the Western Sahara, and what is modern Equatorial Guinea. This is known as "The Disaster of 98" and greatly affected Spanish morale and culture. Further mismanagements in Morocco showed the people that the military was inefficient, the inflation caused by the neutrality in World War I caused great unrest, and ultimately the dictatorship of Primo de Rivera, the failed Second Republic and the Civil War that came from it never allowed Spain to recover until 1978.
Francoist isolationism until the 1960s also meant Spain was never involved with pan-European policies, associations and movements, excluding Spain from establishing any influence.
Long story short: Spain has been continuously mismanaged or in internal turmoil, has traditionally been far overextended, and was unable to recover from continuous wars and conflicts with the other European powers doing everything in their might and power to beat Spain.