It should be obvious to anyone who doesn't have the mental capacity of a Fat dude named KOL.
Just put yourself in Obitos position, he was a 13 year old kid AT WAR. Its like people cant seem to grasp just how twisted that sounds to begin with. Anyways, he was at war and did everything he could to help save this girl he has feelings for and practically grew up with since the academy days. After he saves her he saves his other friend by sacrificing himself. He got crushed by a boulder and was left for dead. Entrusting the friend he saved and gave his "life" for to protect the girl he cares about.
Now he wakes up and finds himself in a cave half broken, covered in bandages, with only an inch of life left in him, and all he wants to do is get back home to Kakashi and Rin. Then he's being spoon fed all these idealisms of Madara about how much the world sucks, yada yada, day after day training, recuperating, and keeping the crazy old mans words locked up in the back of his head, he refuses to listen to it. Til reality comes crashing down on his face. The initial shock of his friend killing the girl he cares about was enough to make him snap.
What kind of world allows an innocent girl to be used as a tool of war. Allows kids to go out, fight, and die for some border struggle. What could have possibly been the cause for all these horrible things to happen thru out history. The Shinobi's world. And its certainly not one Obito wants to be a part of anymore.
Madara was the only one who gave him a glimmer of hope while Obito felt like he was chained down in a fake Hell hole.
Its not that Obito was deluded, His actions and reasons for what he did are VAGUELY Just because its true, Ninjas are power hungry, lying, manipulative, murderers for hire. Its that Obito gave up on the world he lived in. He thought all his ideals he once had were for nothing. No matter how hard you try... you cant save everyone, sometimes you cant save anyone. Obito refused to live like that. He doesn't want the world to be some dark cruel place where everyone is miserable.
He truly wants people to be happy in the IT. But he won't hesitate to kill you if you stand in his way. He's just a man on a mission, just like every other Ninja in this verse.