Compare Medea and Jocasta.
Both Medea and Jocasta commit morally reprehensible acts in relation to their children, albeit for different reasons. Medea is traditionally presented as the epitome of evil for the murder of her children. Her rationale for carrying out such a heinous act is tenuous at best: she wants revenge upon Jason.
Jocasta is also party to a truly wicked act, one in which her baby son, Oedipus, has his legs pinned together before being left to die on a mountain. The difference here is that Jocasta (and her husband King Laius) are attempting to thwart a frightening prophecy (which tragically comes true in any case.) This is not said to justify her actions in any way, it simply shows that her motives are somewhat different from Medea's. Medea's murder of her children is a private act of revenge; Jocasta's exposure of Oedipus can be construed as an act of state carried out for the long-term benefit of Thebes.
Jocasta exposes Oedipus in order to avoid potential trouble; Medea is the instigator of trouble. It was prophesied that Oedipus would one day do great wrong and that he would kill his father. It is understandable why someone at that time would want to prevent this from happening, even if the method used was unacceptable.
However, there is no sense in which Medea's children were anything other than innocent; there was simply no reason for them to be killed. Medea's act of murder was a purely selfish act. At no point was she thinking about the good of the community as Jocasta was. Her children were nothing more to her than collateral damage caught in the middle of a bitter marital dispute.