He wasnt a role model, which why the Jedi Order treated him they way they did.
A Jedi pretty much has to be emotionless based on their teachings, Anakin was incredibly far from that.
He clearly showed a lot of emotions, rage more than anything, he married Padme which is against the teaching of the Jedi Order (You cant marry).
In fact he was originally rejected to become a Jedi due to his age, since he was already old enough to have a persona of his own, rather than being build and (pretty much brainwashed) by the Jedi from really little.
He constantly went against the Jedi teachings.
And like i stated before, for him Padme was priority over anything, and the Jedi has done nothing but to treat him poorly and deny his grown.
And even at the very end he wanted to still be a Jedi and do what was right, but after he killed Windu, it was over, he could no longer be a Jedi and immediately regrets what he did and Palpatine gives him an option, to become his apprentice and embrace the Dark Side, he tells him that to get say powers he had to kill the Jedi himself, (Which was also part of the plan of Palpatine who so far has manipulated him) he knows that in order to Embrace the Dark Side to get the powers to save Padme he couldnt have mercy on his targets, he had to become a monster, which he did, since not doing what Palpatine said, means that he wouldnt get the power he needed to save his wife, and even after doing all that, he regrets it and feels pain because of it to the point that he starts crying for what he did.
In fact the reason why he could kill the children was explained in a comic, (at least until Disney decided to trash all the expanded universe for their garbage trilogy)
Its explained that he was hesitating but the dark side manipulated him by convincing him that it was better to kill them rather than letting them live and have a worse fate, since they were basically orphans and the Jedi were getting murdered and labeled has traitors.
But thats not in the movies so ill leave it there.
(Heres a video explaining that comic btw)
https://www.youtube.com/watch?v=U5k8leZjn9g
Anyway, he is developed to become a villain, little by little, both foreshadowing and character development, since the first movie.