This verse defines the claustrophobic nature of sin and the expansive nature of righteousness.
Evildoers are snared by their own sin
We often think of sin as "freedom" to do whatever we want. Solomon says the opposite: sin is a snare.
But the righteous shout for joy and are glad
Righteousness (doing the right thing) simplifies life. Whoever owes nothing, fears nothing. Whoever tells the truth doesn't need a good memory to keep versions straight. That lightness of conscience produces a spontaneous joy, a desire to shout and sing. It's the freedom of having nothing to hide.
"The Knight in Rusty Armor" — Robert Fisher
The Knight's armor was, literally, "his own snare." He built it to protect himself and show off (the sin of pride/vanity), but ended up trapped inside it. He only started to "shout for joy and be glad" again (feeling the breeze, eating, kissing) once the trap was undone by truth and by tears.
"O Poder da Autorresponsabilidade" — Paulo Vieira
The trap is often the victim mindset. A person gets stuck in cycles of blaming others. The "righteous" (the one who takes ownership) sets themselves free by taking control. Freedom brings the joy of knowing you're the driver of your own life, not the passenger stuck in the trunk.
Jesus is the Liberator who breaks the traps. Psalm 124:7 prophesies this freedom: "the snare has been broken, and we have escaped."
Christ came to loosen the bonds of sin that held us captive. He said: "So if the Son sets you free, you will be free indeed" (John 8:36). A Christian's joy isn't forced; it's the natural reaction of a prisoner who watched the cell doors swing open. We shout for joy because the snare was broken on the cross.