Yes, it was quite the shock and at that time, really hard to understand. But Masato had several reasons to participate in that farce.
First of all, it’s part of his act, and still part of his nature to face his rival Kengo seriously. And that battle was as serious as it gets. Secondly, Riki knew very little of the actual conflict between Kyousuke and Kengo with their respective agendas. While it looked like Riki was challenging Kyousuke, it was actually Kengo trying to subdue Kyousuke while using Riki as a figurehead. By stepping in, Masato could counterbalance Kengo and thus create a Riki vs Kyousuke situation. That’s not a very fair matchup, but Riki really needed to defeat Kyousuke if he wanted to break free from his control. And lastly, Masato remains a neutral party, thus he should be there to keep things fair. Unfortunately, Kyousuke still outsmarted him and pulled off his cheap tricks.
Masato’s position can be seen more clearly in Refrain. When Riki decides on his own course of action, Masato leaves the group. He needs to stay neutral, thus he can’t support this newly-founded party. On the other hand, he can act as a referee in the Kengo vs Riki match. Kengo doesn’t object since he doesn’t doubt Masato’s sense of fairness.
PS: back to the game in Rin2, we all know how much Masato disliked the entire situation.