To answer this question I am going to draw on my personal experiences accumulated from close to 20 years living and working in Spain's capital city, Madrid, and my travels to all parts of the country.
Spain, in my opinion, is a very safe country to live in.
In the time that I have lived here I have never been robbed, assaulted, burgled, or the victim of any crime.
Excuse me a minute while I touch wood.
However, do not believe for one minute that Spain is a crime-free country.
Crime does exist here but it is no worse than any other European country. You can check out some data here.
What are the most common crimes?
Tourist-related crimes and home burglaries are two of the most common types of crimes in Spain.
Pickpocketing, bag snatching, muggings happen in areas that are frequented by tourists.
This happens all over Europe and Spain is no different.
Home burglaries are common in areas where houses are mainly used for holiday purposes.
Some of the coastal areas in Spain are full of housing estates that only fully occupied for 2-3 months of the year. For the rest if the year they sit empty.
One thing that you do need to keep an eye out for is what the Spanish call 'Picaresca'.
What this basically means that there are many people in Spain looking to take advantage of others and the system.
Foreigners coming to Spain to live often fall victim to these crafty individuals who are willing to exploit one's lack of knowledge of how Spain works for their own gain.
Walking the streets at night
When it comes to walking at nighttime Spain is really safe.
There is little alcohol-related violence and you don't get the drunk dickhead culture that you get in many English-speaking countries.
The majority of Spaniards drink alcohol responsibly and a night out in Madrid is a pleasurable experience.
If you are in one of the tourist resorts like Benidorm or Magaluf, you will see idiotic behaviour but it will be from tourists, not the locals.
Live and let live
So don't be worried if you are thinking of living in Spain and worried about your personal security.
Go with the flow, respect the locals, and live and let live.
Learn the language, and try not to stick out like a sore thumb.
And with a bit of luck you should have a peaceful time here in Spain.
BTW, here's an updated version of the video.