One of the themes in the Psalms is a delight in the law. The words approach worship of the law, although that it is not what they mean. That is a bit odd. One might find the law right and good, but to delight in them seems over the top.
One thought is that the Psalmist is referring to the satisfaction felt when they had obey the law, the “Pleasures of a good conscience.”
The law became a subject for study, commentary, and discussion. So, part of what was meant was akin to me loving physics. That has dangers because it might become a matter of pride that one loves the law.
Lewis uses Psalm 119 as an example of a structured poem celebrating the law.
The Jews were exposed to pagan religions that must have looked attractive in hard times. Maybe gods that demanded more (temple prostitution, intact sacrifice, etc.) might save them from enemies. We face the same issues with pagan cultures (in amuck more subtle way).
In Psalm 19 there is an abrupt change from extolling nature to extolling the law. Lewis posits that it is simply due to the fact they simply didn’t see a difference between the two.