I'm in Spain - Madrid city center actually, which has seen some of the harshest numbers of cases world-wide. The government has taken extreme measures because these are extreme circumstances. While the first documented case in Spain was a German tourist on the Canary Island of La Gomera, experts point to a football match in Milan- Valencia versus the Italian club Atalanta, in which there were 40,000 fans in attendance with around 2,500 from Valencia, as the main reason why Bergamo (Milan) is one of the Epicenters of this virus. It's highly likely that at least some of the 2,500 Spaniards came in contact with the virus and brought it back to Spain.
It also didn't help that in the days before the official lock-down started, many Spaniards were traveling back to their family homes. Madrid and Barcelona are like New York and LA- a high percentage of residents, especially young people, come from all over the country to live in these two cities. So you had a large amount of younger people who likely came in contact with the virus in Madrid, going back to spend the quarantine at their parent's houses all over the country, in a lot of cases grandparents live under the same roof as well. This only made the spread more rampant.
As a few have said already, there is a certain incubation period of this virus, and that we have not yet surpassed that amount of time in quarantine yet. Quarantine is a proven method, and let me point out that it's a proactive measure, not a reactive measure. If people continued about their daily lives as normal, the numbers would surely be exponentially higher, and in a country with almost 20% of the population over the age of 65, that would leave an insurmountable impact.
One of the main reasons for quarantining is the hope that it will reduce the burden that the extreme amount of cases puts on the health care system. This isn't a problem specific to Spain, we're seeing severe man-power and equipment shortages world-wide. The same thing happens anywhere when a huge percentage of the population needs one specific service and the demand for the service greatly exceeds the supply. Australia saw the same issue when it came to their forest fires back in January, they had to import fire fighters from the USA, Canada, and NZ. The only difference between that situation and this situation is that every country in the world is facing it at the same time, so it is not possible to import workers or additional equipment from anywhere.
The difference between idiots like Baba Yaga and your average Spanish citizen, is that Spaniards are happy to take on the personal responsibility of staying at home for the betterment of society. I have friends that live in interior apartments and are really having a hard time, but everyone recognizes it as a necessary (but miserable) measure to help the country as a whole. I'm lucky that I have a pretty large apartment with some balconies, so I'm not as cooped up as some, and this certainly is a change in lifestyle and quite annoying, but without everyone making sacrifices and doing their part, the problem would surely be much worse, and the effects on everyone would be much worse for a long time. We're on day #11 of complete quarantine, and hopefully in the next week the numbers will start to level off. 19 days to go.