My theory is: Since obitos body was halfly crushed he could not carry a perfect pair of rinnegan,so before Madara was dying completley he helped obito in getting him back on his feet in training etc etc and made him carry on his legacy after his death.Since Obito could not administer the rinnegan he gave them to another senju kid nagato,who had enough chakra and could use them.Later when the time would come Obito would get them back but still not use them due the above reason and would implant only one as in the mangas we can see that he keeps on saying that my body is still imperfect!I can picture a young obito visting rin's grave without the village knowing about his return and looking towards it with his head down,realising that everything is over and choosing madaras side who is beside him or he takes him there,,,,