I think this is why Obito went bad:
basically you guys remember when mizuki told naruto he was the nine tails? could you imagine what would have happened had iruka not been there? thats obito. Obito by the looks of it did not have a fatherly figure in his life, also by the looks of it did not have any parents. The uchiha clan probably rejected him for all of his life because of his constant failures and i think Minato mostly focused on Kakashi instead of him. So Rin was pretty much the only one who acknowledged him in his life which is why he cared about her so much.
If Obito was indeed an orphan then, Rin, Kakashi and Minato meant everything to him and desperately tried to prove himself to them. So it wasnt how rin died, it was the circumstances in which she did. To see your best friend kill your other best friend and your sensei was nowhere in sight must drive you pretty insane. Obito had seen the horrors of the third shinobi world war and this reflected the words that Madara and Zetsu told him, and no one was there to tell him to snap out of it.
And do you guys remember Obito's words? "Those who break the rules are trash, but those who abandon their comrades are worse than trash! If I'm going to be called trash either way, I'd rather break the rules! And if that somehow makes me anything less than a real shinobi, then I'll crush all of the so-called "real" shinobi!" His philosophy was broken before his very eyes, which is why he tells Naruto his ideals are useless.
So long story short, Obito did not have people like Jiraiya, Kakashi or Iruka like Naruto did, which is why Obito is doing this