An injury-time equaliser from Iago Aspas snatched a point for the 2010 world champions and Iran's late leveller against Portugal meant La Roja finished top of Group B, despite winning only one of their three games.
They twice fell behind in Kaliningrad, with Khalid Boutaib capitalising on a defensive mix-up to open the scoring and Youssef En-Nesyri heading in from a corner after Isco had initially brought Spain level.
Hierro is happy to have won the group but, having watched his side concede three against Portugal in their first match, he admitted that their defensive play "is not the way forward".
"We said this would be a tough match," he told a news conference. "We knew full well Morocco would fight, they have an excellent team, they only lost their two games 1-0 when they deserved much more.
"The first conclusion I draw is that, despite all these challenges, we were on top, so I need to look at the silver lining. Obviously, there are things we need to improve and we're going to be self-critical.
"Five goals in three matches is not the way forward and it's what I've told my players. They're professionals, they understand the situation."
Despite his demand for improvement, Hierro refused to pin any individual blame on centre-backs Gerard Pique and Sergio Ramos, who looked vulnerable for much of the match.
"I assess the entire team, not individuals," he said. "I keep those in-house. In a public forum, I talk about how we can improve as a team as a whole."
Hierro was only placed in charge on the eve of the tournament after Julen Lopetegui was sacked for negotiating a deal to take over at Real Madrid without the full knowledge of the Royal Spanish Football Association.
But the former Madrid defender has made it clear he is in complete command of the group and has not been reaching out to his predecessor for any advice.
"Julen has his job now, I have mine, I have my hands full," he said. "We're not texting each other. We each have our identity.
"Right now, I'm the person who is head coach. Yes, we are friends, we communicate as friends, but we do not talk about football and tactics. Don't think that, whenever I have to make a decision, I call up Lopetegui and ask him!"