Motives for Doing Righteous Things
5 For I remember the word of God which saith by their works ye shall know them; for if their works be good, then they are good also.
6 For behold, God hath said a man being evil cannot do that which is good; for if he offereth a gift, or prayeth unto God, except he shall do it with real intent it profiteth him nothing.
7 For behold, it is not counted unto him for righteousness.
8 For behold, if a man being evil giveth a gift, he doeth it grudgingly; wherefore it is counted unto him the same as if he had retained the gift; wherefore he is counted evil before God.
9 And likewise also is it counted evil unto a man, if he shall pray and not with real intent of heart; yea, and it profiteth him nothing, for God receiveth none such.
10 Wherefore, a man being evil cannot do that which is good; neither will he give a good gift.
11 For behold, a bitter fountain cannot bring forth good water; neither can a good fountain bring forth bitter water; wherefore, a man being a servant of the devil cannot follow Christ; and if he follow Christ he cannot be a servant of the devil.
President Dallin H. Oaks said:
“Have you ever found yourself doing something you thought was right, but doing it because you ‘had’ to? Did you ever keep a commandment of God with an attitude of resentment? . . . Do you think such feelings will be ignored by a Father in Heaven who gave us the willpower we call agency? . . . We are accountable for our feelings and desires as well as our acts. Evil thoughts and desires will be punished. Acts that seem to be good bring blessings only when they are done with real and righteous intent. On the positive side, we will be blessed for the righteous desires of our hearts even though some outside circumstance has made it impossible for us to carry those desires into action.”
(“The Desires of Our Hearts” [Brigham Young University devotional, Oct. 8, 1985], 3, 6; speeches.byu.edu)