The result meant La Roja finished the tournament without scoring a goal and bottom of the section, while the African side had to settle for third place behind Japan and Honduras.
Following the same pattern as their previous two games at the tournament, Spain began the match slowly and it was Morocco, aware that victory was necessary to have any chance of progression, who were brightest during the early exchanges.
Noureddine Amrabat attempted an audacious free-kick from distance which swerved wide of David de Gea’s post after ten minutes and, shortly before the half-hour mark, the north Africans created their best opportunity of the opening period.
A swift counter-attack provided space down their right wing and when the ball was delivered into the Spanish penalty box, Abdelaziz Barrada was waiting at the back post. The midfielder, who plays in Spain with Getafe, dragged his shot wide of De Gea’s goal, however.
Spain were forced to respond and, woken from their slumber, they went even closer four minutes later. Neat approach play from Juan Mata allowed Adrian Lopez to run clear of the Moroccan defence but the Atletico Madrid forward’s effort cannoned back off the post.
With the Manchester rain beginning to fall heavily, Chelsea midfielder Oriol Romeu tried his luck from the edge of the box but his drive drifted wide and signalled the half-time whistle with the score goalless.
Amrabat remained Morocco’s main source of inspiration in the second half, first trying to lob De Gea two minutes after the restart before, on the hour, playing in Barrada, who was denied by the Spanish ‘keeper.
Luis Milla’s Spain team took time to gain a foothold again but when they did, Adrian should have put them in front. Finding himself one-on-one with Morocco ‘keeper Mohamed Amsif after 69 minutes, the striker inexplicably sent a tame effort dribbling away from the target.
Both sides remained committed to gaining a winning goal in what remained of their tournament and the last chance fell to Adrian again, but on this occasion his shot was saved well by Amsif.