Germany that won in 2014 have crashed out at the group stages in the two world cups since.
Spain edged Germany on goal difference to take the second spot.
'I expect from Costa Rica a defensive performance as they did it against Japan. We have to find solutions against that,' said the German coach.
Japan rewarded Ritsu Doan with a start in the game after he scored as a substitute in Wednesday's stunning World Cup upset of Germany.
Spain were mindful of the shock defeats suffered by Argentina and Group E rivals Germany against lower opposition in their opening matches and they tormented Costa Rica from the start, going 3-0 up after little more than 30 minutes.
Joel Campbell's early goal sent Costa Rica to the World Cup for a third successive tournament as they edged past 10-man New Zealand 1-0 in their intercontinental playoff on Tuesday and secured the last place at the finals in Qatar.
There are many destinations around the world that you could visit without breaking the bank, if you have a proper financial and travel plan. Here are a few that you can explore
Naidu received the honorary doctorate (Doctor Honoris Causa) by the University for Peace, Costa Rica.
Naidu said both countries can be significant partners, both from the political and commercial point of view.