How can a psalm say "happy is the one who smashes your babies against the rock"?
It is a hard line. Here is what the commentators say about it.
First, they read it as payback for what Babylon itself did. The Gemara (the rabbis' discussion of the Mishnah) quotes verses 8 and 9 when it describes a scene of horror: a sage named Rabbi Asi says four kav (a measure of volume) of brains were found on one stone. Rashi says that scene belongs to the destruction of the First Temple, the one Babylon carried out. Ibn Ezra reads the verse the same way: it tells how cruel their hearts were, that they smashed the infants of Israel. Radak says the verse speaks "in the way of cruelty, just as they were cruel to Israel."
Second, they read it as something that was going to happen, not as an order. Yeshayahu tells Babylon that when God stirs up the Medes against it, "their babies will be dashed to pieces before their eyes." The Metzudat David (a commentary from the 1700s) says the psalm means Darius the Mede, who destroyed Babylon. The Malbim (a Tanach commentator of the 1800s) says it was Cyrus, who came against Babylon a second time. They disagree on who, but both read the verse as describing Babylon's fall.
Third, look at who is speaking. They are exiles sitting by a river. Rabbi Adin Steinsaltz (a Torah commentator who died in 2020) points out that the psalmist does not say "happy am I if I do this." He hopes someone else will.
These readings explain what the verse is about. Whether it feels easy to say is a different question, and the sources do not try to answer it.
Gittin 58a,Rashi on Gittin 58a,Ibn Ezra, Radak, Metzudat David, Malbim and Steinsaltz on Tehillim 137:8 to 137:9,Yeshayahu 13:16 to 13:18Why would anyone break a glass at the happiest moment of their life?
Because of verse 6 of this psalm: "If I do not raise Jerusalem above the head of my joy." The Shulchan Aruch (the main code of Jewish law) says to put ashes on the groom's head, where tefillin go, and ends its list of such reminders with: "All these things are to remember Jerusalem," quoting this verse. The glass is in a note by the Rema (Rabbi Moshe Isserles of Poland, who added Ashkenazi customs to the Shulchan Aruch). He says some places break a glass at the chuppah (the wedding canopy).
The roots are in the Gemara, Bava Batra 60b. After the Temple fell, the Sages said: when you plaster your house, leave a small square bare. When you prepare a meal, leave something out. When a woman puts on all her jewelry, she leaves off one piece, and for that the Gemara quotes "If I forget you, Jerusalem." Then it asks what "above the head of my joy" means. A sage named Rav Yitzchak says: the ashes on the heads of grooms.
There is also a story in the Gemara, in Berakhot. Mar, son of Ravina, saw the Sages getting carried away with joy at his son's wedding. He broke a cup worth four hundred zuz (coins) in front of them, and they became sad. Rav Ashi did the same with a white glass cup. Tosafot (medieval commentators on the Gemara) say: "From here comes the custom to break glass at weddings." The story says nothing about Jerusalem. The Kaf HaChaim (a law book from the early 1900s) brings both reasons side by side.
Rashi explains the verse this way: the memory of the mourning for Jerusalem's destruction, I will bring up and mention at the head of all my joy. The remembering goes at the top of the joy. It does not replace it.
Shulchan Aruch, Orach Chaim 560:2,Shulchan Aruch, Even HaEzer 65:3,Bava Batra 60b,Berakhot 30b to 31a,Tosafot on Berakhot 31a,Kaf HaChayim, Orach Chaim 560:21,Rashi on Tehillim 137:6This happened 2,500 years ago. Why am I supposed to be sad about it?
The Shulchan Aruch brings it up in its first chapter: every God-fearing person should be pained and worried about the destruction of the Temple (Orach Chaim 1:3). Right away the Mishnah Berurah adds that Torah and prayer should still be done with joy.
How sad, then? Bava Batra 60b asks exactly that. After the Second Temple burned, many people stopped eating meat and drinking wine, because those were offered on the altar. Rabbi Yehoshua, a sage of that time, asked them: then should we stop eating bread, since the grain offerings are gone? And water, since the water offering is gone? They had no answer. He told them that not mourning at all is impossible, and mourning too much is impossible, because a rule is not placed on the public unless most of the public can keep it. So the Sages said to leave one small thing undone.
But you were not there. The Midrash on Tehillim, on the words "raze it, raze it" in verse 7, says something hard: in any generation in which the Temple is not rebuilt, it is counted as if that generation destroyed it. The reason it gives is that the generation did not repent.
The Gemara closes the thought with a promise instead: whoever mourns for Jerusalem will see her joy, and it quotes Yeshayahu 66:10, "Rejoice with Jerusalem."
So the sources do not ask for constant sadness. They ask for something small and regular: one bare spot on the wall, one missing dish, one glass, and a psalm before Birkat HaMazon.
Shulchan Aruch, Orach Chaim 1:3,Mishnah Berurah 1:10,Bava Batra 60b,Midrash Tehillim 137,Yeshayahu 66:10