Those dreams all came crashing down in the space of 90 minutes when they faced the Netherlands in their opening game.
Spain had actually lost their opening match of the World Cup in 2010 when Switzerland snatched a surprise 1-0 win in Durban. On that occasion they were able bounce back and went on to win tournament because it was nothing compared to the humiliation that befell them in 2014.
Few expected the Netherlands to make much of an impact at that tournament. They had qualified strongly, winning their group by a comfortable margin and dropping just two points en-route to Brazil. But there wasn't the same buzz about the Oranje as there had been in previous years.
There were a lot of young players, while only Arjen Robben, Robin van Persie and Nigel de Jong were playing at elite European clubs - and the latter two had endured disastrous 2013/14 campaigns with Manchester United and AC Milan respectively in the build up to the tournament.
For this Dutch team, giving a good account of themselves against a Spanish side filled with world class stars in their opening game was the immediate aim. After that, the team couldn't have been looking for much more than a place in the quarter-finals.
With Spain lining up with Xavi, Andres Iniesta, Xabi Alonso, Sergio Ramos, Sergio Busquets, Gerard Pique and other global stars, Dutch coach Van Gaal set his side up in a 5-3-2/3-5-2 formation before utilising a system with a back three and wing-backs had become a popular trend.
The defensive unit, five of whom were 25 or under and based in the Eredivisie - Jasper Cillessen (GK), Daryl Janmaat, Daley Blind, Bruno Martins Indi and Stefan de Vrij - was marshalled by relative veteran Ron Vlaar of Aston Villa.
Ahead of them, Van Gaal named Swansea's Jonathan de Guzman alongside the aforementioned De Jong, behind 2010 hero Wesley Sneijder, whose career had since dipped. Robben was played through the middle in a free role in support of central striker Van Persie.
Despite an early Dutch chance squandered by Sneijder, it was Spain who took the lead when Diego Costa, that season's Zarra Trophy winner in La Liga, went down under pressure from De Vrij in the penalty area just under half an hour into the game. Alonso then stepped up and fired confidently past Cillessen from the spot to break the deadlock in favour of La Roja.
The Dutch equaliser from Van Persie, which came just moments before half-time, was rather remarkable and landed its scorer with a nomination for the prestigious Puskas Award. As Blind lofted a ball forward from deep on the left, Van Persie peeled off his marker and took flight to meet the ball with his head on edge of the penalty area, looping it over a stranded Iker Casillas.
It was the perfect time for the Netherlands to score and breathed confidence into their second half performance. Spain, meanwhile, simply collapsed under the pressure after the break.
The Netherlands' second came when Xavi of all people lost possession and Blind clipped another pinpoint ball forward. It was expertly controlled by Robben, who then turned inside and put a deflected effort past Casillas. The Real Madrid goalkeeper had failed to claw away a high cross that De Vrij bundled in at the back post.
If there had been question marks over Casillas for the Dutch third, the fourth just eight minutes later was entirely the result of his mistake when a heavy touch after receiving a pass from Ramos allowed Van Persie to steal in and poke the ball home.
An earlier David Silva goal had been correctly ruled out for offside at 3-1, while Van Persie had cracked a thunderous volley off the crossbar at 2-1.
Spain were beaten, but Robben added further salt into the wounds when he scored the Netherlands' fifth and final goal of the game with 10 minutes to go. The Bayern Munich star raced beyond Ramos on a swift counter attack, before checking back, rounding a desperate Casillas and firing past the two helpless Spanish defenders who had made it back to the goal line.
After that defeat - the first time they had conceded five goals in 51 years - Spain were shellshocked and a 2-0 defeat against a talented Chile side sealed their elimination after just two games. The Netherlands, on the other hand, edged out Australia in a five-goal thriller to win their second game 3-2, before beating Chile to top the group with nine points and going all the way to the semi-finals to eventually finish third.
Spain did win their third and final game against Australia, who were also already out, but it was too little too late for the reigning champions, who let their trophy go without so much as a whimper. And that annihilation at the hands of the Dutch has become part of World Cup folklore.
(You may also be interested in '18 Survivors of the 2006 World Cup Who Are Going to Russia '18 This Summer')