Actually, he relies this doing was Madara plan on killing Rin.
Madara told him that he was fooled.
Just how do the zetsu told him about Rin & Kakashi at that location, and the ninja were puppets.
Rin did explained to Obito what's happen that Kakashi killed her.
That made Obito to return and to help Kakashi team to destroy Madara / Kaguya.
Obito's motivation was the death of a child in war, which is nothing new because we know that children have been dying in war far before Obito's era. Obito just happened to be the Uchiha who is most sensitive and the least experienced when it came to dealing with death of close ones, and that's why Madara took advantage of him.