Medea is humiliated by Jason's new marriage and her pride will not quietly suffer this situation -- she is determined to seek revenge. While it would be easy for her to kill Jason, she actually makes some sense when she decides to let Jason live the misery she can invoke! She kills his new bride. But she knows that that action is not going to go unpunished and that both she and the children are now going to be treatened by those loyal to Creon. In Episode 5 she is vacillilating about the decision to kill the children, but part of her decision to do so is, in her mind, to protect them. She says, "This shall never be, that I should suffer my children to be the prey of my enemies insolence." After knowing that the princess and Creon are dead she says, "as quickly as I may to kill my children, and start away from this land, And not, by wasting time, to suffer my children to be slain by another hand less kindly to them." She is suggesting that it would be better to kill her children herself than to have them killed by her enemies. While this does speak to her own pride, she is trying to justify her actions. I don't think this makes the action defensible, but it makes some sense to Medea. She does kill them to punish Jason, but it was not that simple for her.
Personally, I don't think that Medea's actions can be defended. She doesn't suffer from a predetermined fate like Oedipus who from birth was slated for a life of misery and violence. While the audience would sympathize with Medea because of Jason's betrayal and humiliation of her, there is simply no justification for her murdering her children or Creon, who actually tried to help her near the play's beginning.
Even a plea of insanity would be difficult to prove because Medea is cunning and develops an elaborate plot to kill Creon, his daughter, and her own children. The chorus repeatedly tells her not to go through with her plans, and she wavers later in the play in regards to her children's deaths; so she is obviously cognizant that her plan is immoral.