Real Madrid confirmed on Tuesday that Lopetegui would be taking charge on a three-year deal when his commitments with Spain concluded at the World Cup.
However, the announcement appears to have come as a surprise to the Spanish Football Federation (RFEF) and they responded by giving him the boot on Wednesday.
The RFEF say they were not given "any information" about Lopetegui's negotiations with Los Blancos.
Spain are set to kick off their World Cup campaign against European champions Portugal on Friday and Hierro has been placed in charge for the showpiece event.
RFEF president Luis Rubiales said: "I know there's going to be criticism whatever I do.
"I'm sure this will, in time, make us stronger. I admire Julen very much, I respect him very much. He seems a top trainer and that makes it harder to make the decision.
"You can't do things this way, two or three days before the World Cup. We have been compelled to make this decision."