The Bible teaches that we should do good things rather than bad things, and that we should do them from good motives like loving God or loving other people. The Bible condemns bad motives (selfish pride, envy, lust, etc.) along with bad actions (boasting, murder, adultery, etc.).
But good motives and bad motives frequently produce the same good actions. Selfish pride can produce upright behavior; envy can help you provide well for your family; lust can produce chivalry. These actions are all condoned by the Bible, but the motives behind them are strongly condemned.
So what do you do when you are aware of both good and bad motives at work in you to produce the same good action? This is a real dilemma, because it happens most of the time a Christian does anything at all. You truly love your wife and want to treat her to a special evening, and you really want others to see this trophy on your arm at the most expensive restaurant in town... so do you still take her there? If you do, your ego is fed, which is bad. But your wife feels loved, which is good.
Unfortunately, it gets worse. We can't simply change our motives. Our motives are the reasons why we do absolutely everything we do. I can't just stop being a selfish jerk of a pharisee, even though I know it's wrong, because selfishness is something fundamental about who I am. The only reason I would want to stop being selfish would be if I were unselfish. But I'm not, I'm selfish.
Here's an illustration that I fully expect to be controversial, but please try to see it for what it isâ€”an imperfect illustration. It's kind of like you're a factory robot, plugged into one electrical socket when you should be plugged into another. You can't pull your cord from the one and plug it into the other, because the cord supplies the energy to make your arm work in the first place. It takes an external operator to make that change. In the same way, the Holy Spirit must make the change of motives take place in your heartâ€”and you can't make him do it. Left alone, you wouldn't even ask him to.
Good newsâ€”you're not left alone. You can't produce a new heart for yourself, but you don't have to. The fact that you're wrestling through these issues is a good indication that the Holy Spirit is working in you to change your motives from bad to good. God has promised to give his people new hearts (Ezek. 11.19-20; 36.26-27), which is something that happens to all believers.
But even the wisest, most mature believers still struggle with muddled motives. The Apostle Paul saw two forces at war within himself: the new self vs. the old self (Eph. 4.17-24; Col. 3.5-10); the spirit vs. the flesh (Gal. 5.16-25); the law of the mind vs. the law of sin (Rom. 7.14-25). He despaired of ever becoming perfect in this life, and you should too.
What? Despair of becoming perfect? That's right. We're not here to become perfect. We're here to get a little better, and to trust Jesus along the way. If we were perfect, we wouldn't have constant need of Christ. You can actually be thankful for your imperfection, because it's God's way of making you dependent on him, and you will see more of his grace.
It's inescapable: you're going to have bad motives mixed in with your good ones, for probably every action you undertake, for the rest of your life. Every Christian is in the same boat. But your hope isn't in escaping bad motives, it's in escaping the condemnation for bad motives. And that you have done, if you believe in Jesus Christ.
Jesus lived an impossible human life. He only ever did good things. And he only ever did them from good motives. Not one time was an action of his tainted by evil desires, for his whole life. Even when he was facing torture and a completely unjust death at the hands of evil men, he had only goodness in his heart. Perfect love toward God his Father. Perfect grace toward the humanity that would reject and kill him. Perfect righteousness in thought, word and deed. He deserved no condemnation: only heavenly approbation.
If you believe in Jesus, this is yours. The condemnation you deserve every second of every day by bumbling about life with bad motives, he took. The peace and wholeness that you long for, but could never achieve, he gives. So you and I continue to stumble, and sin, and try not to sin (but still do)â€¦Â and there is no condemnation for those of us who are in Christ Jesus by faith (Rom. 8.1).