The psalms are different than the bulk of Scripture in that they are the record of people speaking to God rather than God speaking to people. Under the guidance and oversight of the Spirit, they have become part of the biblical witness. That doesn’t mean everything in them is in line with God’s will or that they are always worthy of imitation. Rather in the psalms we see the human spirit struggling to be a holy spirit. And God thought it was valuable for us to have a record of their experience to aid us in our journey.

Psalm 139 is a pinnacle psalm. Like Psalm 23 or 51, it speaks in such highly personal terms that it leaves us with the feeling of being brought before the throne of God. The central idea of the psalm is how God knows us and is with us. Verses 1 and 23-24 function as an inclusio, with v. 1 stating, “You have searched me, Lord, and You know me” and v. 23-24 God is asked to continue to search him to “See if there is any offensive way in me, and lead me in the way everlasting.”
We hear of God’s intimate knowledge of us in v. 1-4 as the words “searched,” “know,” “perceive,” “discern,” and “familiar” are all employed. The writer’s conclusion from all this is, “You hem me in behind and before, and lay Your hand on me. Such knowledge is too wonderful for me, too lofty for me to attain” (v. 5-6).
He adds a second layer as He moves to God’s presence with us (v. 7-18). The pronouns “You” and “Your” (in reference to God) are used eight times in six verses (7-12). In v. 13ff we learn that even in the womb, God was with us and working for us and creative words (“created,” “knit,” “made,” “woven together”) are used six times in four verses (v. 13-18). With this he has scaled the mountain and reached the pinnacle—His knowledge and presence show we are known intimately and loved ultimately. This prompts the psalmist to say:
How precious to me are your thoughts, God!
How vast is the sum of them!
Were I to count them,
they would outnumber the grains of sand—
when I awake, I am still with you.
Surprisingly the psalm doesn’t end here.
In not only continues, but it takes a sharp turn away from the meditation and exaltation of God to an excoriation of those who oppose God. The writer who was praising God now calls down God’s judgment on the wicked and lets God know how he hates them (“I have nothing but hatred for them” – v. 22). Not only are we taken aback by the abrupt shift of subject by the writer, but his tone has gone from placid and praising to vindictive.

May tells us these words are to be understood as “a rhetorical identification of self with God in the matter of the wicked. The topic of the wicked offers yet one more way in which the psalmist describes his life as an existence that is completely within the sphere of God’s knowledge, work, and ways.” I suppose that’s possible, but the psalmist doesn’t sound like he serves a God will send Jonah to preach to the Ninevites or have Hosea pursue his unfaithful wife Gomer. I think it’s more likely the psalmist (in his imperfect understanding), saw this as the way he thought God would think and act toward evil.
To his credit though, the writer doesn’t stop here either. He finishes with this prayer in v. 23-24:
Search me, God, and know my heart;
test me and know my anxious thoughts.
See if there is any offensive way in me,
and lead me in the way everlasting.

He’s aware of “offensive” ways that may lurk in his life though he doesn’t know what they might be. He knows that God does and asks Him to “lead me in the way everlasting.” That’s what it means to have faith. It’s the reaching hand of the flawed man.
Hopefully, we connect with this part of the psalm as much as we did the first part—when the writer was speaking of God’s intimacy. For although we are known intimately and loved ultimately (and rightly rejoice in this), we are nonetheless flawed people and we will be until we see Jesus. Until that time, the words of v. 23-24 should be a part of our prayers as well.
That’s how we finish strong.