The Matildas had rested a string of top players, including striker Sam Kerr, for the friendly but a tactical switch and three substitutions at half-time further weakened the side.
Spain, ranked seventh in the world and warming up for their Euros campaign, took full advantage and three goals in the last 10 minutes blew out the score to leave Australia with their worst defeat in a quarter of a century.
- Lynch: Matildas left counting cost of humbling Spain defeat
- Subscribe to ESPN's Women's Football Podcast: The Far Post
Gustavsson defended resting the top players for welfare reasons and said he had wanted to use the match to take a look at some younger talent ahead of next year's Women's World Cup, which Australia will co-host.
"There's probably going to be some reactions of 'Why did you play such a good team with such an inexperienced roster?'" the Swede told reporters on Sunday.
"But I think we need these answers. Not short-term, and especially not for me -- I'm going to be scrutinised now but it's not about me -- it's about the long-term legacy '23 and beyond.
"Not just preparation for the World Cup but investments past that World Cup and I think the answers that we got now is a wake-up call for a lot of people."
Gustavsson said he had always intended to take a different approach to each half and bring some less experienced players on after the break.
"I want to be clear now, this is not about blaming individual players for this loss. These players are more representing a situation we're in right now," he added.
"We finished the game with four players playing in the [second tier] NPL and one player playing in college. And to expect those players to match up to Spain is not fair on the individuals.
"But I am ready to take that hit as a coach. I've said that from day one, we need answers and we need investment in our programme."