I believe the word “wrong” in your question gives us the answer. Everything we do is either “right” or “wrong” and this includes the “motive” for what we do. For example, if you give money to some charity but you are giving in order to draw attention to yourself in some way, it is a sin. In that case even though you are “doing something we would call good,” the “motive is wrong” and that makes the whole thing wrong.

We actually have an example of this very thing in the Bible. In Acts 4:32 we read of how the early church was “of one heart and one soul; neither did anyone say that any of the things he possessed was his own, but they had all things in common” (NKJV). Verse 34 goes on to say, “Nor was there anyone among them who lacked; for all who were possessors of lands or house sold them, and brough the proceeds of the things that were sold, and laid them at the apostles’ feet; and they distributed to each as anyone had need.” What love and devotion we see in these humble acts of generosity toward others! Now let’s read Acts 5:1-4, “BUT a certain man names Ananias, with Sapphira his wife, sold a possession. And HE KEPT BACK PART OF THE PROCEEDS, his wife also being aware of it, and brought A CERTAIN PART and laid it at the apostles’ feet. But Peter said, ‘Ananias, why has Satan filled your heart to lie to the Holy Spirit and keep back part of the price of the land for yourself? While it remained, was it not your own? And after it was sold, was it not in your own control? Why have you conceived THIS THING IN YOUR HEART? You have not lied to men but to God.’ Then Ananias, hearing those words, fell down and breathed his last. So great fear came upon all those who heard these things.” What was the main sin of this couple? Ah, they wanted to “receive praise from men for giving to charity” and they also wanted everyone to think they “gave all that they had.” This SIN began in their heart; their MOTIVE was to be praised and to still keep some money for themselves. When Peter, as directed by the Holy Spirit, realized what they had pretended to be more loving and devoted than they actually were, he accused Ananias of lying to God and then God judged him by taking his life. As we read on, we see the same thing happened to Sapphira. How solemn! Their act of giving would have been accepted had THEIR MOTIVE BEEN PURE, but since THEIR MOTIVE WAS WRONG, God would not accept it and His chastening Hand came down upon them.

The Day is coming when every believer in Jesus Christ will have his/her whole life reviewed before the Judgment Seat of Christ (see 1st Corinthians 3:5-15 and 2nd Corinthians 5:9-10). Everything we did or said, from the moment we were saved until the moment we are taken to heaven, will be judged by Jesus Christ. “Each one’s work will become clear; for the Day will declare it, because it will be revealed by fire; and the fire will test each one’s work, of what sort it is…that each one may receive things done in the body, according to what he has done, whether good or bad” (3:15; 5:10). Everything that was done for the glory of God and for the blessing of man will be rewarded (verse 14), but everything that was done for one’s own glory will suffer loss (verse 15). You may be thinking, “But these verses say nothing about one’s MOTIVE.” True, but as we read on in 1st Corinthians 4:5 we see that the “MOTIVE behind the ACT” comes into view, “Therefore judge nothing before the time, until the Lord comes, who will bring to light the hidden things of darkness and REVEAL THE COUNSELS OF THE HEARTS.” Here we have the MOTIVES that led to our ACTIONS. If our “motives are WRONG” (because they reveal that we desire SELF-GLORY) the “act will be REJECTED” and we’ll lose out on a reward.  (DO)  (502.3)