Your statutes are my songs in the house of my pilgrimage.
If you recall, the immediately previous verse speaks of the burning indignation the psalmist had because of the wicked. While he had a right perspective of the wicked, he did not lose his perspective of the Christian life. Even while living in this sinful world, the psalmist had a song in his heart!
J. M. Boice reminds us that:
Verse 54 also speaks of singing in the midst of suffering, so wonderful is God’s comfort in such times. Is that really possible? Paul and Silas sang in prison at Philippi, after having been severely beaten. They were doing it in the middle of the night, which is another thing the psalmist mentions (“In the night I remember your name, O Lord,” v. 55). The story in Acts says, “About midnight Paul and Silas were praying and singing hymns to God, and the other prisoners were listening to them” (Acts 16:25). After witnessing such faith it is no wonder the Philippian jailer and many others believed on the Jesus Paul and Silas proclaimed and no wonder God established a strong, enduring church in Philippi. It was this church that backed Paul’s missionary work, time and again helping with his expenses (Phil. 4:15–16).1
As we walk through this life as pilgrims in a foreign country, we must never lose sight of the amazing hope that we have. In the midst of the darkness and suffering and tragedies, the children of God will always have reason to rejoice. They should always have a song in their heart.
Let us come before His presence with thanksgiving, let us shout joyfully to Him with psalms.
The singing of Christians does not make the causes of their sorrows go away—though the Lord sometimes does that himself—but it does lift their spirits and testifies to the goodness of God, who provides comfort even in bad times.2
1 Boice, J. M. (2005). Psalms 107–150: An Expositional Commentary (p. 1000). Grand Rapids, MI: Baker Books.
2 Boice, (p. 1001).