The Law is a prickly subject (as this Psalm explores). The problem is that humans have some kind of nature (born that way and what not) and the Law often times requires that those who follow the Law deny their natural desires. That means there is a constant tension between what any person wants and what the Law expects.
This difference gets highlighted in the various issues of sexuality quite often but it applies across the board of behavior. Just like a person has a natural desire to do all kind of things with their genitals so too does a person have a natural desire to do all kinds of things with that gun or with their money or their words.
The Psalmist does not deny this conflict (contrary to popular belief the Bible rarely hides from the difficult questions) but rather makes it the central theme. But the perspective will a little unusual to modern ears because it assumes that the Law is good and human desire (though normal) is not good when it contradicts the Law.
In particular I like Psalm 119 better than other Psalms because the speaker laments his own sinfulness rather than cursing the sinfulness of others:
1. Blessed are the undefiled in the way,Verses 1-4 seem sort of standard advice: You will be happy if.... Now my secular friends and I might have different ways to fill in that blank but from a structural stand point most advice starts the same way: "You will be happy if...." These verses give a little more detail saying not just to walk in the way of the Lord but to do so with a whole heart and with diligence. So half-way obeying is not going to cut it.
Who walk in the law of the Lord!
2. Blessed are those who keep His testimonies,
Who seek Him with a whole heart!
3. They also do no iniquity;
They walk in his ways.
4. You have commanded us
To keep Your precepts diligently.
5. Oh, that my ways were directed
To keep Your statutes!
6. Then I would not be ashamed
When I look into Your commandments.
7. I will praise You with uprightness of heart,
When I learn Your righteous judgments.
8. I will keep Your statutes;
Oh, do not forsake me utterly!
Verses 5-8 make a dramatic shift and suddenly the Psalmist is transformed from the Pharisee in the temple thanking God for making him into such a good person into the tax collector in the temple afraid to look up but just asking for mercy.
Freud would not be surprised by this transition from high ethical standards to anguish and guilt but I think many in our society would be. All too often morality is seen and used as a weapon against non-believers and those who do not meet up with a person's definition of what is good are shown wrath. This is commonly understood happening in a religious context but covers almost any standard of human behavior: are you a good parent, are you punk, what kind of wine do you drink etc. These standards are most often used to judge other people and less commonly (though not unheard of) used to judge one' own self. And not surprising when we judge ourselves we often tend to be a lot more understanding.
This self inflicted judgment is the next step in maturity because when a standard is used against one's the standard has been judged to be good in-its self. I have never heard of someone really getting down on them self for not being goth enough (after high school any way) but the standard that people use to terrorize themselves is used because it is believed to be actually Good, more worthy than ourselves.
Though Freud would disagree with me (along with many others) the belief that we are not Good is the first step towards the possibility of an ethical life. Now how the Bible would describe the rest of the steps is a topic for another book of the Bible.