We do not usually consider law as a source of wonder. Laws are regarded as boundaries we ought not transgress rather than as thresholds of wonder. However, for the people of Israel, the word 'Law' (Torah) did not have the narrow legalistic meaning that it has for us. In fact the first five books of the Bible were know as the Torah, because they reveal the story of God's loving plans for his people and what he expects of them. So 'Torah' means instruction, something that shows us the way, reveals God's will; not so much as a code of rules to be observed but as a way of life to be followed.
The psalmist knows that we can observe God's law with all our heart only if we understand its spirit, that is, the principles underpinning it.
Fr. Kevin O'Shea, C.M. (From Sunday Notes by Fr Kevin O'Shea at http://shmi.info/ )