In essence, this Psalm is a description of the house built on the rock, versus the sand (see Mt 7:24-27). The righteous build their lives on the law of God, his word. The wicked build it after his own way, which leads to destruction both now and into eternity.