Rin died and now Obito blames the ninja world for her death which is why he became Tobi and wants to put an end to violence and all ninja's, once his mask comes off there will be flashbacks of Rin etc that explains it all? Also yes we did see Obito get crushed by all this rocks but no one ever found his body, Kakashi never visits his grave because he only has his name written on the memorial wall. Lots of possible ways he could have cheated death, could have used Izanagi in the last moment by accident or saved by someone and that's how he got his powers and motivation
Don't flame me for being stubborn or something, I just think Tobi is most likely Obito and I'm trying to create possible ways for how this could have happened and his motive.
Oh and Rin probably gave Tobi/Obito the idea of transplanting sharingans