We should compare the beginning of Ps. 34:10 with the wording of vv.1-2—those who persist in wickedness have many sorrows or inner pains of anguish in stark contrast to the true happiness of the one who turns from sin and finds forgiveness.  But David supplies another contrast in the second part of v.10–trusting in the Lord ensures protective love.  However, take note the opposite concept of wickedness that David puts forth; not a more expected word, such as righteousness, but believing.  Believing God’s words about God’s way is the remedy for wickedness.  This means that unbelief is the root cause of all sin.  Unbelief in what God has said is the reason why we stubbornly go our own way despite the fact the Lord has been clear about the way we should go.

So in contrast to the many sorrows of the transgressor, the one who trusts in the Lord or places oneself under what the Lord has said, has the steadfast, covenant, loyal love surrounding him.  Just like v.7, this is language of protection, in that trusting in the Lord always puts us the safest spot possible, even if we incur the mistreatment of others as a result.  Reason being, our sin against a Holy God and the subsequent guilt are the greatest threats to our souls.   It follows then that trusting in the Lord regarding what he says about sin and what to do about sin provides the greatest blessing.  It’s no wonder David commands God’s people to rejoice greatly in the Lord, but notice how he describes God’s people—those who are righteous and upright.  It’s those who conform to God’s ways and walk down straight moral paths instead of paths of crookedness.  And this quest starts in the heart because that is where wickedness or righteousness springs forth from—Luke 6:43 For there is no good tree which produces bad fruit, nor, on the other hand, a bad tree which produces good fruit. 44 For each tree is known by its own fruit. For men do not gather figs from thorns, nor do they pick grapes from a briar bush.  Thus to clean up behaviors apart from dealing with the inner cravings that led to those behaviors in the first place is a great example of that deceit David mentioned in v.2.  That which pleases God flows from the heart and not from self-righteous attempts at self-improvement.

Therefore, the reason why conformity to God’s ways brings so much joy is because righteousness and uprightness enables a clear conscience and nearness to God.  Furthermore, part of what encompasses righteousness and uprightness is knowing we won’t walk perfectly in the way and thus we will need to obey God in confession and repentance.  All the while, we know that God loves to grant forgiving grace to broken and contrite in heart.
David himself had tasted both the sorrows of failing to repent and the joys of repentance and thus, he beckons all to choose the right path.