Why does Medea escape punishment?
Medea murders her brother Absyrtus to facilitate her's and Jason's escape from Colchis. In some versions of the myth - most notably in Euripides's eponymous play - she also murders her sons to revenge Jason for abandoning her. Yet, uncharacteristically for kin-killers in Greek mythology, she suffers no punishment for her crimes.
Why is that? Why isn't Medea punished?
Apollonius of Rhodes, in his Argonautica, tells that Medea and the Argonauts actually did fall out of favor with the gods for killing Absyrtus. Zeus found out fairly quickly and was characteristically angry:
When Apsyrtus had fallen in mighty overthrow Zeus himself, king of gods, was seized with wrath at what they had done. And he ordained that by the counsels of Aeaean Circe they should cleanse themselves from the terrible stain of blood and suffer countless woes before their return.
Argonautica, Book IV
This is not immediately made clear to the voyagers, and they blissfully travel onwards. Fortunately, Hera takes command and stirs up a storm, pushing them to the island of Electra, where they are told of Zeus' command. After passing through more dangers (as per the "countless woes"), they reach Circe, living on Aeaea. When she discovers what they have done, she offers a sacrifice to Zeus, thereby purifying the murderers:
And straightway Circe became aware of the doom of a suppliant and the guilt of murder. Wherefore in reverence for the ordinance of Zeus, the god of suppliants, who is a god of wrath yet mightily aids slayers of men, she began to offer the sacrifice with which ruthless suppliants are cleansed from guilt when they approach the altar. First, to atone for the murder still unexpiated, she held above their heads the young of a sow whose dugs yet swelled from the fruit of the womb, and, severing its neck, sprinkled their hands with the blood; and again she made propitiation with other drink offerings, calling on Zeus the Cleanser, the protector of murder- stained suppliants. And all the defilements in a mass her attendants bore forth from the palace--the Naiad nymphs who ministered all things to her. And within, Circe, standing by the hearth, kept burning atonement-cakes without wine, praying the while that she might stay from their wrath the terrible Furies, and that Zeus himself might be propitious and gentle to them both, whether with hands stained by the blood of a stranger or, as kinsfolk, by the blood of a kinsman, they should implore his grace.
Argonautica, Book IV
It might seem strange that Medea was let off so easily - honestly, reading the passage, it seems like a token ceremony. However, remember that the voyage to Aeaea was fraught with peril; it was only due to a second intervention by Hera that the Argonauts survived at all. Apollonius doesn't spend much time on this, but it's important nonetheless.
As far as I can tell, Medea's filicide was the invention of Euripides; it wasn't in the older versions of the tales. It's also a morally ambiguous act. Medea originally conceives of the idea to punish Jason, who wants to marry Glauce:
. . . for that [murder] will stab my husband to the heart.
Medea is likely also referring to her murder of Glauce, which she achieves by means of a poisoned dress (delivered by Medea's children, in Euripedes' version - a twist of irony). Again, this is meant to hurt Jason.
She of course wrestles with her qualms, but later on, she also tries to justify it by saying that if she doesn't kill her children, they will either be murdered or tortured by someone else:
Nay, by the fiends of hell's abyss, never, never will I hand my children over to their foes to mock and flout. Die they must in any case, and since 'tis so, why I, the mother who bore them, will give the fatal blow. In any case their doom is fixed and there is no escape.
She repeats this thought process shortly before actually killing her sons:
My friends, I am resolved upon the deed; at once will I slay my children and then leave this land, without delaying long enough to hand them over to some more savage hand to butcher. Needs must they die in any case; and since they must, I will slay them-I, the mother that bare them.
Presumably, Medea thinks it is impossible for her to escape if she still has her children. Therefore, she wants to avoid subjecting them to more pain. She clearly still loves them; just read any of her short soliloquies on the subject. In the very end, she rejects her original motivation - to harm Jason - and attempts to commit the murder out of love.
It's worth noting that Jason, too, believes the children might be harmed, because of Medea's murder of Glauce. However, his response is to protect them, not kill them - although he arrives too late:
As for her, those whom she hath wronged will do the like by her; but I am come to save the children's life, lest the victim's kin visit their wrath on me, in vengeance for the murder foul, wrought by my children's mother.
It's also her way of really sticking it to Jason, since in Euripedes she not only kills his children, but also his new bride, thus ensuring he will have no posterity.