The Fathers and the Saints have attached spiritual senses to this passage, such that “infants” represent our sins in their early stages and that they should be “smashed”, i.e. overcome before they become deep-rooted. It’s a good interpretation.
However, that’s a spiritual sense, specifically, the moral. As such, it is a secondary, an extended interpretation. The primary sense of Scripture is always the literal, and we always start there. In that primary sense, this “barbaric” passage says exactly what it says: blessed is the Jew who seizes Babylonian children and bashes their heads against rocks.
Part of the beauty of the Psalms is that they express the whole spectrum of human emotion, including the desire for revenge and retribution. For the devout captive Jew in Babylon, there was no greater pain than to see Jerusalem and the Temple laid waste by Nebuchadnezzar, and this desire to see Babylonian kids bashed in was the Psalmist’s way of saying he wanted to see a similar pain inflicted on his Babylonian captors.
It is not to be taken as a command, or a justification to murder Iraqi children. It simply tells us how the Psalmist feels, how deep his pain runs and how he wants the Babylonians to experience the same pain he feels. This Psalm tells us something about each of us. If someone were to tell me he had never, at least once in his life, experienced a desire for revenge, to hurt someone who had hurt him with the same or greater pain that that someone had inflicted, I’d call that person a liar to his face. Every one of us has had a desire for revenge, and the Psalmist captures this in the literal sense. The Temple was the most precious possession of the Israelite people, so much so that they consider punishing Babylonians with the death of their children the equivalent of their own national loss.
Of course, in reality, that likely never happened. Wholesale murder of Babylonian children would easily have resulted in the suppression or extermination of the captives.
When praying this Psalm in Christian prayer, when meditating on its literal sense, we are well reminded of Jesus’ commands regarding revenge and love of enemies, how he upheld the Law and brought it up to perfection. This is one reason I regret that the Church has dropped this last verse from Psalm 137 in the Liturgy of the Hours, because although violent, it challenges us to think deeply on the Gospel message regarding sin, revenge and love of enemies.