Spain-born Achraf Hakimi - one of 14 foreign-born players in Morocco's 26-man squad - dispatched the country of his birth with the winning penalty in a 3-0 shootout victory following a goalless 120 minutes.
There followed wild celebrations and Regragui shrugged off being dropped while being thrown in the air by his players.
Regragui, himself born in France, claimed vindication after fighting for foreign-born players to gain greater acceptance within the national team.
"For this I have fought," he said. "Before this World Cup we had a lot of problems about the guys born in Europe and guys not born in Morocco and a lot of journalists said, 'Why don't we play with guys born in Morocco?'.
"Today we have shown that every Moroccan is Moroccan. When he comes to the national team he wants to die, he wants to fight. As the coach, I was born in France and nobody can have my heart for my country.
"This is what I say to the players. Every time they come to the national team they give 100 per cent.
"What is good is that players are born in Germany, Italy, Spain, France, the Netherlands, Belgium - every country has a football culture and we have created a mixture and I'm very happy with that."
Victory makes Regragui the first African coach to lead a team to the quarter-finals of a World Cup, but the 47-year-old said he was not interested in such matters.
"I don't care because I fight to make it not about nationality, to make it not about passports," he said. "You have the competence - you can do it, or not. For me it's not about being Arabic or African.
"I am an ambitious coach and I try to give this to my players. Maybe when I am an old man I will see behind me and be proud."
Spain dominated possession but Morocco had the better chances in the first half before defending doggedly in the second, surviving a late scare when Pablo Sarabia struck the post in the third of three minutes added on.
Sevilla goalkeeper Bono, born in Canada, was then the hero of the penalty shootout, saving from Carlos Soler and Sergio Busquets after Sarabia hit the post.
The goalkeeper was at the centre of celebrations which lasted several minutes on the pitch as the Moroccan fans stayed to join the party.
"We felt the support of all our fans, be it in Morocco or any country in the world," Bono said. "This gives us the impetus to give such a performance.
"When you're in the thick of it you can't really realise what you have just achieved but we are happy. We need to keep focused on what we need to do. Maybe as time goes on we will realise what we have just achieved."