Ok, let's recap what we know about Obito's backstory:
Obito grew up with the dream of becoming Hokage and winning Rin's heart. He wasn't very close to either goal, but at least he was in the running. It was something he could be contempt with. However, for the sake of his friends, he decided to give up his own goals so Kakashi and Rin could reach theirs instead.
(Un)fortunately, his life was salvaged by Madara and Zetsu. During his recovery, Zetsu talked about this awesome idea: how to rid the world of sadness and let everybody reach their own goals. This sounds kinda sweet to Obito, but he's not quite buying it yet. He has a home to go to. He can live out the rest of his life pursuing his dream. It's not over for him yet.
Well, we all know what happened. He sees Kakashi murdering Rin first hand. Two of his major goals have now been shattered; not only will he never be together with Rin (in fact, she died a horrific death), but how can he return to Konoha now? Return to see his best friend who just murdered his love interest despite trusting him with her life? Why does he want to lead a village that was likely responsible for putting Rin in that situation in the first place? Heck no, his dreams are as good as gone.
Now Madara's plan doesn't look half bad. He's sure as hell not the only ninja in the world who has had their dreams taken away, nor is he the last. Why is it such a bad thing to ensure that people get what they want?
-----------------------
I believe that Obito does have the good of humanity in his mind. Rin is just his piece of the pie. The manga does talk about it a bit obsessively, but that's not unique to the Rin dilemma. He's ultimately another Naruto parallel with Madara's influence woven into the picture.