I am going to have to say off of pure speculation like many others, that Rin was a traitor of the Mist. Obito is adhering to Madara's plan of Infinite Tsukuyomi because he wants to remove the reality he is living in, the reality that his cherished friend, Rin, is a traitor, a victim of the war that was killed at the hands of his best friend.
Maybe he doesn't want to accept this reality and this is his only way of dealing with it? so no one ever has to go through what he had to.