Vilda, 42, was dismissed by Spain last month as part of the fallout to ousted Spanish Football Federation [RFEF] president Luis Rubiales' unsolicited kiss on forward Jenni Hermoso after the World Cup final.
Morocco confirmed the appointment of Vilda in a short statement on Thursday and he is expected to be officially presented this weekend.
His first games in charge will be later in October when the Atlas Lionesses face Namibia over two legs in the second round of the CAF Women's Olympic qualifying tournament.
Vilda, meanwhile, was in charge of Spain as they went all the way to the final and beat England 1-0 to win the competition for the first-ever time.
However, that victory was clouded by Rubiales' behaviour in the aftermath of the match, when he kissed Hermoso, who has since pressed charges for sexual assault and coercion.
A court case is underway at Spain's National Court, with Vilda testifying this week as a defendant for his role in allegedly pressing Hermoso and people close to her to release a statement exonerating Rubiales.
Vilda was also widely criticised for repeatedly applauding Rubiales during an emergency RFEF assembly in which the latter railed against "false feminism" and vowed not to resign after the final.
After spending time at Barcelona's, Rayo Vallecano's and Real Madrid's academies as a player, Vilda joined the RFEF in 2009 as the assistant coach to his father, Angel, with the under-19 women's team.
He went on to coach the U17s and the U19s before taking the senior side on in 2015 when previous coach Ignacio Quereda resigned after the players had called for his dismissal.
That led to the players pushing for change at the RFEF behind the scenes. They wanted the federation to make significant improvements to travel, preparation and the backroom staff, and they complained about elements of Vilda's management style on and off the pitch.
After being ignored by the RFEF and denying the accusation that they were attempting to blackmail the federation into sacking Vilda, 15 players announced in September 2022 that they would no longer play for the national team until there were significant changes.
Before the World Cup, three of the 15 returned, another five were willing to but were not called up, and seven continued to make themselves unavailable.
During the tournament, Vilda refused to speak about the fractures among the squad, instead preferring to focus on the 23 players he took with him to Australia and New Zealand and events on the pitch.