O’Neill was delighted with Northern Ireland’s start on a warm and sticky night in Palma, when Ballard headed home a free-kick from debutant Caolan Boyd-Munce.
With Euro 2024 around the corner, O’Neill said he knew facing a “highly motivated” Spain would be “difficult” for his young team, who drew with Romania and defeated Scotland in March’s two fixtures.
“We couldn’t have started the game any better with the goal and we worked hard on set-pieces, making sure we could use them well,” he said.
“We just didn’t defend our box. On the first goal, we could do better on Pedri but it’s a real piece of quality for the finish.
“For the other goals we don’t defend crosses, it’s as simple as that.”
Despite the heavy scoreline, O’Neill said the game will benefit his young squad as he looks to build the next generation for Northern Ireland.
“We have players in our group like Jonny and Corry [Evans] who have played in these games before and know what it’s like, but for our younger players we have exposed them to the top level of international football.
“The goal gave us a great start and we looked on the front foot, but suddenly we were behind and we looked a little bit shocked by that,” said O’Neill, who added that Morata’s goal to give Spain the lead “knocked the confidence” of his team.
“That’s part of the experience. We’re away from home against a top side, you have to stay in the game.”
While Spain get ready for their Euro 2024 opener, Northern Ireland will travel to Murcia to take on Andorra on Tuesday in a match that should be vastly different to Saturday’s encounter.
O’Neill expects his players to learn from the defeat and take that into the game against the minnows, who themselves were defeated 5-0 by Spain on Tuesday.
“It was difficult, but in the second half we made changes and freshened the team up, and we contained Spain,” O’Neill said.
“The game maybe dropped a gear, which was natural with the heat and conditions, but we have to learn from this.”