I feel bad for Obito too but he is getting his wish. He wants to die to be reunited with Rin. I know a lot of people believe all of this was just for Rin, but it was not. He grew up without family like Naruto and he was considered kind of goofy-someone who kind of hears his own drummer. He was caring, he helped people, didn't really pay attention to time which caused some animosity on his team. He knew Rin cared for Kakashi but he valued her friendship anyway.
He truly believed that that IT would be a better world where people's dreams could be fulfilled. He was young, naive and impressionable when Madara got a hold of him and he bought Madara's lies hook, line and sinker. Why shouldn't he? Madara was his saviour. He would have died if not for Madara. He had a horrific accident and nearly died, gave his eye to someone he thought was a friend only to see that "friend" murder the only person who truly cared about him and who he loved. Believe it or not there are probably many people in this world whose first love turns out to be their only love. How many people wouldn't go over the deep end with so many horrible things happening to a person in such a short period of time? I think anyone would think that the world was horrible under those circumstances.
I do not excuse all of the killing he did to obtain his goal. He manipulated people at will, had all 7 of the other jinchuriki's killed, killed and hurt many other people along the way. He deserves to be punished for all of the bad that he did because he was an adult and could have made different choices once Madara was gone.
In his defense though, he did realize he made bad choices and is trying to make up for them by helping the alliance. I would like if he did not die yet. I think somehow Madara will be back and I would like to see Obito get his own back from Madara. Madara took such joy in telling Obito he set Rin's death up that I would like to see Obito help kick his ass.