In addressing C.S. Lewis' comments about the imprecatory psalms, we dealt primarily with generalizations. But the comment about bashing in the heads of Babylonian infants in Psalm 137:9 demands our attention.
First of all, we should note again that the psalmist's maledictions are never merely personal. The psalmist in 137 is bemoaning the injustices committed against Israel by Edom and Babylon. The historical context is most likely the fall of Jerusalem at the hands of the Babylonians in the early 6th century BC, during which time the Edomites availed themselves of Judah's weakened condition and further violated its citizens - their distant cousins. The prophecy of Obadiah is directed against Edom for this particularly heinous atrocity and callous aggression (cf. Jer.49:7-22; Isa.34:5-17). You'll note the similarlity between these prophetic declarations and the psalmist's prayer. Obadiah, for instance, declares, "As you have done, it will be done to you; your deeds will return upon your own head." The Psalmist in 137, now in reference to Babylon (cf. Hab.2:4-20; Jer.50-51; Isa.13; 21:1-10; 47), writes, "happy is he who repays you for what you have done to us," v.8. If in this the psalmist is accussed of sin, let it be acknowledged that it is because he celebrates the justice of God in His righteous judgment against the cruel destroyer. And v.9, of course, must be read in its immediate context. It is applying and particularizing the principle articulated v.8. As they have dashed our children to the ground, so let the avenger (who, as it turns out, will be the Medo-Persians) dash their infants!
It was a common, grisly practice in ancient warfare (see 2Ki.8:12; Hos.10:14; 13:16; Nah.3:10; Lk.19:44). Sadly, it is not unknown in modern times either; during WWII at Bromberg, it was observed that the S.S. would "take the Jewish children by their feet and break their heads by striking them against the wall..."
In fact, it is prophesied by Isaiah that such fate would fall upon the Babylonians themselves, who committed such violence:
Their infants will be dashed to pieces before their eyes; their houses will be looted and their wives ravished. See, I will stir up against them the Medes, who do not care for silver and have no delight in gold. Their bows will strike down the young men; they will have no mercy on infants nor will they look with compassion on children. Babylon, the jewel of kingdoms, the glory of the Babylonians' pride, will be overthrown by God like Sodom and Gomorrah.
As they have done to others, so it will be done to them. And again, it would appear that the psalmist in 137 is celebrating or anticipating God's coming justice against the Babylonians - gruesome as it is! This makes us uncomfortable. Can we really celebrate such brutal justice? But here we might recall (again) that heaven itself calls the church to similarly celebrate the terrible retribution that falls against "Babylon the Great," the violent oppressor of the saints, in Revelation 18:1-19:3. Justice will have been thereby established on the earth.
Justice here does not necessarily pertain to the question of the relative guilt or innocence of the infants. In Scripture it is assumed that infants are not morally culpable agents (e.g., Isa.7:16). Rather, this judgment is conceived as coming against the Babylonian aggressors. We might note that God has destroyed the life of infants elsewhere in judgment directed against the parents, most famously in the case of David (2Sam.12:13-15). We might also note the death of the firstborn in Egypt by God's mysterious agent, "the Destroyer," as judgment against Pharaoh's obstinance.
Of course, as Scripture makes clear, the sons are not imputed with their father's guilt, nor vice versa (Ez.18:20). So the children are not considered guilty for their father's atrocities. However, the scriptures also say: "[God] does not leave the guilty unpunished; he punishes the children and their children for the sin of the fathers to the third and fourth generation." In other words, there are divinely instituted consequences for sins which affect generations (though God here sets limits on their impact, by His mercy, whereas His grace abounds to thousands of generations). My sin and its detrimental impact cannot be neatly confined to my own life. So, the infant in David's case is not held as culpable for his father's sins, but he is to some extent punished for them. More directly, David is punished through his child's illness and death.
Even so, it is asked, how is this fair? Here we must go back to the biblical framework for human history: creation and fall. The wages of sin is death, and so all die because, in Adam, "all sinned," even those who did not sin by actually breaking the commandment (Rom.5:12-14). Throughout the course of our lives, our actual transgressions bear witness against us concerning our damnable condition. But we are under curse from the moment we're conceived. As David wrote, "Surely I was sinful at birth, sinful from the time my mother conceived me," Ps.51:5. It is the tragic reality of "Adam's helpless race." And as a result, "in Adam, all die," (1Co.15:22). The judgment that befell us in our forefather was death - a death graciously prolonged in the case of many, allowing some of us an entire life-time in God's patience and grace. Nevertheless the whole human race is on death row. No one gets out of here alive. Moreover, none of us can demand that we are given first breath upon birth - not to mention God's continual care for us within the womb (e.g., Ps.139:13-14). We live by mercy alone, and we will die by justice.
All this to say that it is not unjust for God to bring the infant's life to an end, according to his purposes in judgment and providence, any more so than bringing the octogenarian's life to an end in a tragic car accident.
Lastly, we must be careful to maintain the distinctions Scripture maintains. If it is in fact just that the evil that I have perpetrated against others be exacted against me (in one form or another), it is not necessarily just for someone to enact it. When the Medes came against Babylon, and dashed their infants' heads against the ground, though they unwittingly carried out God's judgment against the Babylonians, they themselves acted wickedly - just as the Babylonian's and Assyrian's violence against the infants of Israel and Judah were, in and of themselves, unjust, and yet the vehicle of God's just judgment against His own people (e.g., Hos.13:16). Once again, the cross stands as the ultimate illustration of this principle. Jesus' unjust condemnation and crucifixion - for which those agents who were responsible are held culpable by God - was in fact the foreordained means (e.g, Ac.2:23; 4:27-28) of God's righteous accomplishment of His saving purposes (Ro.3:25-26).
Moreover, even if the retributive principle can be justly applied by the hands of men, it obviously does not follow that I am the one to enact it.
Lex talionis was established not to justify revenge or excerbate violence through endless retaliation, but rather to delimit retribution in Israel's courts, and to undercut personal vengenence. God alone is the avenger in Scripture, and we look ultimately to him to establish justice for us.
In summary, we cannot read Psalm 137:9 as a justification for infanticide. But we would do well, in response to this psalm and others like it, to remember that it is a terrible thing to fall into the hands of the living God. It is always wrong to take human life without justifiable cause. But God has justifiable cause against us! And as the Judge, He sovereignly determines how justice will be executed. This ought to humble us, and yield repentance. Rather than assigning blame, or seeking (in vain) to unravel God's myterious providence, Jesus tells us in light of similar tragedies, "unless you repent, you too will all perish," (Lk.13:1-5).