I won't say fluke, but few factors went in their favor.
First, in International soccer, home advantage is quite a big factor - when 60-70K fans are cheering for you, it really makes a difference. In WC, hosts prepare for 2/3 years at home condition, which is a big plus. Russia isn't a great creative side, but they are a decent European side with very good organization - today, they came to defend and to their credit they equalized, albeit from a penalty. However, Spain failed to score in 120 overs from open play - their only goal was an own goal from a set piece. That Coaching changeover ultimately cost them a WC QF at least. I don't think Hierro had the preparation time to replace Laputegi, neither he had the maturity for such a job suddenly, and the players didn't hide that.
Another issue I feel is teams have found a way to counter tiki-taka. Possession is good, but it doesn't help much keeping 75% possession with a series of short, accurate squire passes, unless it ends to a shot or header at the goal. These days, teams are allowing Spain to keep possession, but they are over crowding the attacking 3rd and passing time by keeping ball at Spain's feet. When required, instead of slow build-up with may be 20 passes, teams are attacking Spain with 2/3 long passes and covering lots of distance in much lesser time. Del Bosque's Spain was a treat to watch because they had skilled players, but speed as well - Torres, Villa, Iniesta, Pedro, Silva, Navas, Mata, Iniesta, Cesc were much younger and faster; along with possession, they could press hard and hit on counters; because their mid-field could produce deadly through balls and could run with the ball as well.
Today, I felt it's like a practice session - a set of Spanish forwards were perfecting passing between themselves. They failed to beat Portugal, Morocco and Russia in 90 minutes, and was hard pressed by Iran in 2nd half. The day they get their nose ahead with couple of early goals, they might kill some team (recently beat Argentina 6-0), but most days organized teams will frustrate them. Not enough to win the Cup I think - 2nd round or SF exit doesn't matter much for a side that is playing for the ultimate price and started WC as joint 3rd or 4th favorite.