One of my personal heroes is a man named Colin Smith. He was my Hebrew prof and one of the few men by whose influence my faith was salvaged and strengthened and encouraged in the direction of vocational Christian ministry. I recall him saying on several occasions that it is impossible to read the Psalms properly without understanding the structure of the entire Psalter and that Psalm's place within it. He died suddenly a number of years ago and I was never able to ask him for further clarification. But through the years, that has been a major question in my mind. Here is a very interesting [edited] article on the relationship of the Torah, Psalter, and Matthew's gospel by Peter Leithart that may serve as a partial answer, aid, or starting point:
Jesus the Singer
Matthew is famously organized by five large blocks of teaching (5-7, 10, 13, 18, 23-25). This hints that Jesus is the new Moses, but the Psalms too are organized into five books, mimicking the Pentateuch (1-41; 42-72; 73-89; 90-106; 107-150).
The Psalms are a sung “Torah.” Perhaps Matthew has drawn on the Psalms also when arranging his account of Jesus’ life.
Consider the first of Jesus’ sermons.
Psalm 1 begins with a “blessing” on the man who walks faithfully with Yahweh. Jesus too begins with beatitudes on those who live out the righteousness of God. Both use botanical analogies for the righteous and wicked [trees, fruit, chaff, thorns].
Psalm 1 concludes with the wicked being blown away like chaff unable to stand in the judgment. Jesus' conclusion: His pronouncement at judgment, “I never knew you” and ”Winds blowing” down the house upon sand.
Another layer: If Matthew follows the history of Israel from Genesis through the decree of Cyrus, perhaps the Psalms roughly follow a similar sequence, moving through Israel’s history, through David and the kingdom, into exile and beyond. There is some evidence for this. If so, then we might expect matches between the five sermons of Matthew, the periods of Israelite history, and the books of the Psalms. That makes sense in the center of Matthew. Matthew 13, the third discourse, is a set of parables (maskil) on the kingdom, and the third book of Psalms begins just after a celebration of the ideal king (Psalm 72), begins with a meditation on the triumph of the wicked (Psalm 73), includes several maskil Psalms (Psalms 74, 78, 88, 89), and ends with an extended meditation on the Davidic covenant (Psalm 89). The latter part of Matthew links with the work of Jeremiah and the coming of the exile, and the latter portion of the Psalter also sings of exile (“by the waters of Babylon”) and return.
In any case, at least at the beginning and end, the Sermon on the Mount follows the first Psalm. And this makes one suspect that Jesus’ other sermons are also songs, and that Matthew has not only written a new Pentateuch but also a gospel story built on the musical transformation of Moses that is found in Psalms.