First off, part of Anakin's whiny-ness is natural. He's a teenager in Episode II. In case you don't remember being a teenager (or haven't been around any teenager ever), here's a newsflash: teenagers are whiny (okay, not every teenager is whiny, but they all have moments of whiny-ness). That being said, I don't think what was shown in the films was over the top.
Secondly, you must understand just how damaging being a child slave and the death of his mother was to Anakin. The movies did a good job of pointing out that Anakin was upset by his mother's death. If you don't believe me, just ask the clan of Tusken Raiders he slaughtered in Episode II.
Any way you slice it, Anakin is hurting emotionally. He does not trust others to make right decisions because anyone in power of him when he was young abused that power. He's lacked control all of his life so his way to compensate for that is to gather all the power and control he can over others. He wants to make things "right," no matter the cost. Thus, whenever he is frustrated in these attempts to gain more power and control, he appears whiny, just like a child (since that is where his emotional maturity was stunted).
When it comes to Episode III, Anakin is less whiny. That probably speaks more to the matuirty that comes with age than any emotional growth that has been made.
The Jedi order does not exactly appear to be nurturing to Anakin. Even well-meaning Yoda tells Anakin what to do, rather than helping him to help himself during their Episode III therapy session. What he was saying was wise counsel, but not counsel that Anakin was ready to hear in his emotional state.
|"Two of these midichlorian chewables you should take. Then call me in the morning you will."|
However, unlike most of us, Anakin had a really manipulative father figure pulling the strings behind the scenes. Anakin was persuaded to believe that the Jedi were truly evil. If you think about it from a twisted point of view, it makes sense. The Jedi order talked about being peacekeepers, but they sold themselves out to lead a war. They talked about not seeking power, but were reluctant to share power with Palpatine (nevermind that it turned out to be with good reason). From what Anakin could see - at least what Palpatine/Sidious let him see - the Jedi were a bunch of hypocrites bent on abusing their power. Growing up a slave, Anakin hated this. Add to this the side benefit of becoming powerful enough in the Dark Side to save his wife, killing off a bunch of evil Jedi seemed like the "right" thing to do.
Working with troubled teens, I've seen kids do some horrible things and feel completely justified because of what they learned from their family/life experiences. 99% learn to overcome their past, but some can't or won't.
Being "whiny" is key to Anakin's fall. No emotionally healthy individual would make those same choices. I for one am glad George Lucas created him that way. It makes sense that he would become Darth Vader. Not only that, it makes Darth Vader that much more intimidating - rather than less - because with his emotional instability you don't know what his limits are.