When considering this question, students will first need to think about the ancient source in which they are encountering Medea. Several different sources tell the story of Medea killing her children (e.g., Euripides' Medea, Seneca's Medea, Ovid's Metamorphoses).
Euripides' version of the story is the most famous. In that play, Medea is shown as wavering between killing her children by Jason and sparing their lives. At around lines 1079-1080 in Euripides' Medea, the title character indicates that she knows what she is doing is dreadful, but that her anger is too strong to overcome those feelings.
Also, Medea has a very strong sense of pride and she does not want to be laughed at or mocked, especially after being divorced by Jason. So, to retaliate against Jason and ensure that she does not become a source of laughter for her enemies, Medea takes away what is most precious to him, his male children.
Medea's children were innocent, but in her mind destroying them was the most effective way to get back at Jason, who would have to live for the rest of his life knowing that his divorce of Medea led to the deaths of his sons.