Julen Lopetegui has been fired as Spain’s national coach on the eve of the World Cup, after agreeing to take over at Real Madrid.