Taking care of Momoshiki Otsutsuki and the other was one of the terms of the deal between Black Zetsu and Ueno Kei. Naturally, the deal benefited both Black Zetsu and Ueno Kei. Since Black Zetsu could help Ueno Kei eliminate such an opponent, why would Ueno Kei refuse? As for whether Black Zetsu had some hidden agenda, wasn't that perfectly normal? After weighing the pros and cons, Ueno Kei concluded that this deal offered more benefits than drawbacks. All he had to do was provide a coordinate; it was hardly difficult.
Moreover, this was merely one part of the deal. There were other crucial terms that swayed Ueno Kei, and those were the key reasons he ultimately reached an agreement with Black Zetsu. Thus, no matter how great the aftershocks of the coming battle were, no matter whether Black Zetsu could defeat Momoshiki Otsutsuki by relying on those trump cards, Ueno Kei no longer cared who won or lost. Let them tear each other apart like dogs. All Ueno Kei had to do was remain steadfast and accomplish his own goal!
Furthermore, another piece of intelligence Black Zetsu had traded to him was one of the reasons Ueno Kei left. Obito had finally made a move! Ueno Kei had never known—or perhaps Hamura and Hagoromo did not fully understand either—that Black Zetsu was not using Obito to deceive the Ninja World while seeking some other means to revive Kaguya Otsutsuki.
Black Zetsu had only one path from the start: Obito was the key to reviving his mother! Ueno Kei had thought those were two separate matters, when in truth they were one and the same. This was an important reason why Ueno Kei had made a relatively mistaken judgment!
Since Obito had appeared, Ueno Kei naturally could not remain indifferent.