He's an idealist + egotist. He wants everything to go his way, the right way, and is willing to use his Jedi powers to make things go his way.
He expresses frustration at the Senate for all the political maneuvering that keeps them from getting things done. He'd rather see a strong leader with the proper ideals take control and make people fall in line than all the discord sown by people in the democracy game for their own personal gain.
And he's also afraid of loss thanks to his mommy issues, meaning he takes personal responsibility for everyone and everything around him, which is what drives him to become such a powerful Jedi and decorated warrior. You can see this from the moment he discovers Qui-Gon is a Jedi, since he apparently believes it's the job of a Jedi to fix absolutely everything, even slavery.
When the Jedi are revealed to be just as susceptible to shady backroom dealings as the Senate, and particularly when their advice to him in his time of [perceived] need is [perceived by him as] less than helpful, his loyalty to them dissolves. He then turns to the person who he believes is actually willing to help him: Palpatine.
It's at this moment, when he trust Palpatine completely, that Palpatine reveals that he's actually the Sith Lord the Jedi have been looking for. Anakin knows he should turn him in, but when desperation seizes him, he's willing to turn his back on his Jedi duty based on the splinter of hope Palpatine is offering him - he already doesn't trust the Jedi anyway and knows he'll be thrown out for revealing his relationship with his wife, and at least Palpatine is offering to help... right?
It's in that moment of weakness that he decides to kill Mace to rescue Palpatine, taking the step beyond the point of no return as far as his relationship with the Jedi is concerned. And with nothing more tethering him to the Jedi and their code, in this incredibly vulnerable and broken and desperate state, he's willing to be persuaded to do anything to cling to the one thing he has left - Padme - because he can't bear to lose the last person he believes is on his side.
Meanwhile, Palpatine is also promising him that they'll be able to rid the galaxy of corruption and finally restore peace. It's something he was already in favor of anyway, but now he gets to be the hammer that crushes all the things he felt were getting in the way of his ambition for a better universe - including the Jedi.
And then Obi-Wan, his best friend, turns on him - and, from his point of view, turns Padme against him. Now it's not just that the Jedi make him uncomfortable or are obstacles to his ambitions - his best friend has taken the only thing he cares about from him.
Anakin became evil because all his reasons for being good were stripped away from him, one by one, and he was given reasons (naturally, false machinations orchestrated by Palpatine) to hate everything he ever cared about.