Roots of Spanish
Spanish, like many other Romance languages, traces it's roots back to Latin. More specifically, the roots of Spanish are firmly entrenched in Vulgar Latin, the organic original form of the language. This is because Spain, like much of Western Europe, was invaded by the Romans, who spoke Latin. The roots of Spanish also have a mild influence from the Visigoth language. The Visigoths invaded Spain, and were the first barbarians in the Roman Empire. They tried to bring their language with them into Spain but most of their attempts were rebuffed as the people who lived in what is modern day Spain preferred to speak vulgar Latin.
Geographical InfluencesThere are other influences that had an impact on the roots of Spanish. These vary depending where in the country you are. But, as a general rule, the roots of Spanish in the north are influenced by the Basque language. The Basque region once was an autonomous region and indeed there are stills signs of this today, everywhere in that area. The area has its own very distinct culture so it really should come as no surprise that it has it's own language too.
Having said that, with Spanish growing up next to it for these years, it is also no surprise that the two languages have converged and added and borrowed things from each other's languages in order to make ease of communication between speakers of the different languages easier. Those in the south are heavily influenced by Arabic - much like the Moorish culture and architecture, all thanks to the influence of nearby Morocco. Again, it is a similar situation to in the north, the difference being that Morocco is a different country. Again, here the two countries trade off many facets of culture and although French is the most commonly spoken language in Morocco now, Spanish is still there to be seen - especially in the two Spanish enclaves in the north of the African country.
Other InfluencesIt is also fair to say there are numerous other influences on the Spanish language and it's roots. There is plenty of evidence in the Spanish of today to suggest that the Celtic language also played a part in shaping Spanish as it is today. It is generally assumed that this Celtic influence, in the way certain words sound, must have come from Celts living in what is now Spain at the time the language was taking shape.
This article refers to the roots of Spanish and it is worth noting that this means Castilian, the form of Spanish that is the one taught to those learning the language. Castilian is not spoken everywhere in Spain, for example in the north, Basque is spoken and in the Barcelona region it is Catalan. But most people, wherever they are in Spain, will understand Castilian, even if it is not their first choice. But having separate languages in a country means that they all also undeniably would have had an influence on each other as people moved from place to place. This means that the roots of Spanish and the other Spanish languages can often be all caught up with one another.