Why did the Zero-Tails appear inside Yomi's body and revere him as its master? It turned out that this had all been Nawaki's plan to destroy Moryo!
Just as Nawaki had predicted, Moryo was a chakra-based lifeform and therefore could not be completely killed, at least to a certain extent. Before coming to the Land of Demons for negotiations, Nawaki had already devised a way to deal with Moryo: use the Zero-Tails clone's devouring ability to consume Moryo's soul and body separately! Since the Zero-Tails had been transformed from a fragment of the Ten-Tails' inner demon, it could not only devour chakra and negative spiritual energy, but also strongly contaminate true souls. Moryo's soul had already been filled with dark power, so the devouring process went exceptionally smoothly.
On the second day after arriving in the Land of Demons, Nawaki ordered the Anbu to secretly capture Yomi and his four companions. He then used his Mangekyo's ultimate genjutsu, "Pure Land," to repeatedly brainwash the five of them. After nine days and nine nights, he finally converted them completely. Yomi and the others became fanatical believers, while Nawaki himself replaced Moryo as their master.
After completing these preparations, Nawaki had the Zero-Tails clone parasitize Yomi's body, then ordered him to lead the hundreds of Operations Division members from the Anbu branch station in an attack on the sealing hall.
Because the Zero-Tails clone's dark chakra was extremely similar to Moryo's power, it easily deceived the Land of Demons' shinobi. And as expected, Moryo stepped into the trap himself.
The reason Nawaki used Yomi for this plan was not only to have him gain Moryo's trust, but also to mislead the Land of Demons' upper ranks and keep Konoha out of the matter, making everyone believe it was an internal conflict within