Spain arrived in Qatar as one of the tournament favourites, but La Roja suffered a second consecutive last-16 elimination via a penalty shoot-out after a 1-1 draw at Education City Stadium.
Pablo Sarabia, Carlos Soler and Sergio Busquets all failed to convert as Morocco ran out 3-0 winners in the shoot-out, with the latter duo seeing their efforts saved by Yassine Bounou.
Spain have now lost four of their five penalty shoot-outs at the World Cup, more than any other side in the history of the tournament, with their latest loss throwing the future of Luis Enrique – whose contract is set to expire after the competition – into doubt.
However, the former Barcelona boss says he will take time to consider his future, adding he is happy with the support he has received from the Spanish Football Federation (RFEF).
Asked whether he would stay on after the game, he responded: "I cannot tell you, I don't know this decision. This is not the right time to discuss my future, it's not relevant.
"My contract is going to end, but I am very happy with the national team, with the federation, and I have always had great support from [Jose Francisco] Molina, who is the sporting director.
"I could always carry on. I need to have peace of mind to decide what's best for me and the team."
Luis Enrique initially led Spain from July 2018 to June 2019 before stepping aside for "family reasons" that were later confirmed to relate to his young daughter suffering with cancer. She died in August 2019.
He returned to the role that November, leading Spain to the semi-finals of Euro 2020 and to the 2020-21 Nations League final, where it was beaten by France.
Spain's failure to score a single penalty in Wednesday's (AEDT) shoot-out made them just the second team to do so in World Cup history, after Switzerland against Ukraine in 2006.