Most “good” things I have ever done in my life have been for the wrong reasons. Most of the time the motivation behind my actions centered on impressing other people. I imagined what they would think of me. I imagined that they would like (adore) me because of the “good” thing I was planning on doing. My carefully calculated, externally observable behavior, was evil (attempting to induce others into worshipping me) masquerading as good. I think the Prophet Joseph was talking about frauds like me when he said, “There is one thing under the sun I which I have learned and that is that the righteousness of man is sin…” (TPJS 317).
Jesus called us actors (hypocrites). Moroni made it very clear:
Is it better to participate in a service project with a bitter heart or not participate at all? Is it better to pay tithing with a bitter heart or not at all? Is it better to fast with a bitter heart or not at all?
“All the religious world is bosting of righteousness; it is the doctrine of the devil to hinder our progress, by filling us with self-righteousness. The nearer we get to our Heavenly Father, the more we are disposed to look with compassion on perishing souls; we feel that we want to take them upon our shoulders, and cast their sins behind our backs. If you would have God have Mercy on you, have mercy on one another.” (TPJS 241)
It’s not that we should give up on righteousness, it’s that we should give up on trying to be the one that decides who is righteous. If you’re righteous God will let you know by sending angels (see Moroni 7:37). You can try to prove it to yourself and waste your time and efforts. Or you can wait on Him, who never changes, who can’t be tricked, and who employs no servant at the gate, to let you know when you’ve become something worth note. Angels don’t come without faith. Faith can’t come without meekness (Moroni 7:43). Self righteousness is the great enemy of meekness.
In The Words of Joseph Smith the quote from the prophet Joseph above is slightly different; and the difference is instructive.
“All the religious world is boasting of its righteousness–it is the doctrine of the devil to retard the human mind and retard our progress by filling us with self righteousness.” (Words, p. 123) The prophet also added in the same talk,
“We are full of selfishness–the devil flatters us that we are very righteous, while we are feeding on the faults of others” (Words p. 124)
Because it is often impossible to know the “why” behind any particular action, we are warned against judging.