At the heart of Attack of the Clones is the internal moral struggle not of choice but of motive.
Like The Phantom Menace, Attack of the Clones once again shows the Eastern idea of detachment that is prominent among the Jedi characters. When Anakin complains about his nightmares regarding his mother, Obi-Wan simply tells him that "Dreams pass in time." Instead of exploring his feelings and maybe doing something about his mother's potential plight, Obi-Wan's advice is to let go of his attachment. He gives the same advice to Anakin regarding his attachment to Padme. The Jedi mentor is afraid that his padawan's feelings will cause him to do something foolish.
But the action first finds its roots in motivation.
The German philosopher Immanuel Kant said that the most moral actions were ones that were done out of duty to a moral imperitive and not because of feeling. To use an example from Dr. Peter Kreeft, imagine Blackbeard the pirate and St. Francis of Assisi were walking down the street together. Suddenly, an armored car hits a bump on the road, causing a sack of cash to fall right in front of the two walkers. Blackbeard very much desires the money, but by sheer force of will he restrains himself from taking it. St. Francis, however, has built up a long habit of denying his greedy desires so that now he feels no temptation whatsoever to pick up the money. In that moment, Kant would say that Blackbeard was more moral than Francis because Blackbeard was motivated by duty rather than feeling.
This emphasis on duty over desire is found throughout the film.
The very first scene shows Captain Typho telling Padme that her murdered handmaiden died performing her duty so that the Senator could do hers. Anakin is constantly reminded by Obi-Wan of his commitments to the Jedi order. Padme talks about how she was relieved to be out of office, but now serves as Senator of Naboo out of duty.
Much of the movie's story is moved by the conflict between desire and duty. Particularly, we see that Anakin has three major desires that are in conflict with his duty: his desire to help his mother, his desire to help Obi-Wan, and his desire to be with Padme. Both of these desires take him away from his given commitments. Even though he is charged by the Jedi Council to guard her, he plans to abandon Padme to save his mother on Tatooine. Padme remains with him volunatarily anyway. He is ordered to remain with Padme directly by the Jedi Council and not rescue his father-figure Obi-Wan. But Padme gives him a semi-legitmate excuse to go on a rescue mission. Finally, his desire to be with Padme is in direct conflcit with the celibate life prescribed for all Jedi.
In this film, every time Anakin gives in to these duty-conflicted desires, something bad happens. When he goes to rescue his mother, Anakin takes his first step towards the Dark Side by giving in to his anger and slaughtering the Sand People. When he goes to rescue Obi-Wan he and Padme end up captives condemned to death, unable to rescue themselves. Finally, his desire to be with Padme moves him to live a lie in defying the Jedi code (which leads to greater tragedy in Episode III).
Nowhere else does this tension between duty and desire appear more clearly than in the chase of Count Dooku (whose name is very similar to the Buddhist concept of suffering: "dukkha."). While in pursuit, Padme is thrown from the ship. Anakin wants to stop and rescue her but Obi-Wan pleads that more lives could be saved by pursuing Dooku. When Anakin responds that he doesn't care, Obi-Wan warns him that saving Padme could result in his expulsion from the Jedi Order. Finally, Obi-Wan asks him what Padme would do if the situation was reversed. Anakin finally responds, "She would do her duty." And so Anakin joins Obi-Wan in his fight against Dooku.
But Anakin is dispatched very quickly because of his impatience. Rather than listen to Obi-Wan's strategy and work together to take Dooku down, Anakin rushes in. It is clear that he wants to finish this task quickly so that he can make a hasty return to Padme. So his desire for Padme motivated his rash behavior and thus caused the suffering at the hands of Dooku.
So does this mean that the movie is siding with Kant in his philosophical ethics?
I think the key to understanding the morality is the distinction selfish and selfess desires.
When Padme asks Anakin if the Jedi are forbidden to love, he says that attachment is forbidden, but compassion is encouraged. In this sense, the Jedi are mandated to love.
The Jedi view attachment as a form of selfishness (more on this in Episode III). And when it comes to Anakin's choices in Attack of the Clones, you can see how that plays out. His selfish desire for revenge leads his genocidal outburst. He felt great pain and desired to unleash that pain on others.
And we see his selfishness regarding his relationship to Padme. Rather than choosing either to be a Jedi or to be a husband, he decides to live a lie and not give up either. If he had made a choice one way or the other, the tragedy of Revenge of the Sith would not have taken place.
But the tragedy also could have been avoided if the Jedi took a larger view of desire. Attachments like loyalty, family, friendship, and romantic love are not part of the Jedi mindset. They do not see how these things can lead a person away from selfishness and towards selfesness.
Aristotle understood the necessary role that feelings play in our morals. He did not believe that a person was virtous simply because they did what was right. For Aristotle, the goal of moral action is not to accomplish moral goods but to shape the character of the moral agent. Doing what is right without wanting to do it is not enough. These people he calls "continent." They would be like Blackbeard who controled his selfish desires. But for those like St. Francis who shaped their souls in a way so that they enjoy doing the moral good, Aristotle calls them "virtuous."
The Jedi do not move from continence to virtue. Instead of following Aristotle and shaping the emotions to enjoy and desire the good, their solution is to get rid of desire all together.
But this cannot stand, especially for someone like Anakin. His feelings are viewed by the Jedi as a deficit. They do not realize that they are an asset if they can be directed properly. But because they do not give him this outlet, he finds his duty and desires in conflcit rather than in harmony.
And Attack of the Clones shows how living in the extremes regarding desire can lead to badness. The Sith give in to their darker impulses and inhuman slaves to their desires. Dooku's ambition leads to all out war. But the Jedi attempt to deny their desires completely and are in their own way inhuman. Even Yoda cannot live by this ideal completely. When Dooku ends their lightsaber battle by attempting to kill Obi-Wan and Anakin, he makes the same choice that Anakin wanted to make earlier: he wants to save those he cares about instead of defeated Dooku. So even Yoda cannot help giving in to desire.
A balance must be struck. And Anakin desires this balance but cannot find it in Attack of the Clones.
Maybe this was what the prophecy meant about the one who would bring balance to the Force.