The greatest threat to David and his people was not some external nation or empire, nor some insidious spy in his court working for some other interest. The greatest threat was departure from the Covenant. More specifically, the greatest danger was that Israel would lose her moral power to live in this world. Obeying Moses harmonized her life with the moral fabric of the universe. Lose that and she can’t defeat children throwing spit wads. Keep that and no power on earth can oppose her. Other nations could come and go at random, but the only reason Israel existed in the first place was her mission to reveal God’s character in how the people lived.
Thus, David cries out to God with the assurance that if his or the nation’s sins have raised a barrier to God’s favor, they might as well dig his grave. Chances are the image of a holy temple at this point would be the Tent of Meeting in David’s royal courtyard. It was a symbolic gesture in the first place, raising the hands in supplication to some great power. David recognized only Jehovah as his ruler.
It stands to reason David was facing a rash of crimes by deception. That is, people were playing politics and currying the favor of their neighbors while plotting to destroy the social stability God granted as a covenant blessing. It didn’t matter what the plotters thought they might gain; their actions would destroy shalom. David was counting on God to read the hearts of deceivers like that and keep His promise to root them out. Often such a cleansing came from a direction the plotters never dreamed. God’s sense of poetry and beauty always flavored His justice.
This is a God worthy of all praise. His Law included a generous measure of mercy for human weakness in those who genuinely loved to serve Him. David counted himself fortunate to be included in God’s favor. Every time he turned around, God was once more fulfilling His promises in ways that left David marveling. It was for the sake of His own divine glory that God protected David and the Nation of Israel. His tenderness for Israel was bigger than the legends could tell.