Of what does true virtue consist? What determines a person’s moral character? Charles Finney deals with that in his Systematic Theology. His language is not modern, so some of this may be hard to follow for some people, but I would urge you to think this through carefully. Here’s what he says:
Now this intention originates volitions [i.e., the power to make one’s own choices or decisions]. It directs the attention of the mind, and therefore, produces thoughts, emotions, or affections. It also, through volition, produces bodily action. But moral character does not lie in outward actions. . . . Moral character belongs solely to the intention that produced the volition that moved the muscles to the performance of the outward act. . . .
Moral character no more lies in emotion, than in outward action. It does not lie in thought, or attention. It does not lie in the specific volition that directed the attention; but in that intention, or design of the mind, that produced the volition, which directed the attention, which, again, produced the thought, which, again, produced the emotion.
So it all comes down to the intent of the heart, the motive for why we do the things we do. There are only two ultimate intentions: to serve God or to serve self. That’s why Jesus condemned the Pharisees who, although they were doing outwardly good things, were doing so with a wrong motive: for their own vanity.
Once we get the intention/motive right, then God is pleased with the outward action.