What does Matthew 6:4 mean?
In this passage, Jesus has expanded on chapter five's main idea: that inner thoughts and attitudes are part of how God judges our righteousness. Using the example of giving to charity, He explained that selfish motivation means no heavenly reward. Doing the right thing for the wrong reason is not righteous, it's egotism.Although Jesus is teaching a negative principle in this passage, He is revealing an exciting truth: God sees His people, even what they do in secret, for a positive purpose. He wants to give rewards to believers. Christians should expect that God will reward righteous behavior if done with the right motives.
Jesus has shown that this requires intentionality and strategy. When it comes to giving to the needy, for instance, Jesus commands secrecy instead of drawing excessive attention. The purpose of this command is to avoid the trap of turning generosity into a performance. Believers should give in order to help others, and to glorify God—not to earn praise or approval from people. Since human hearts are so devious, and it is so easy to fall into that kind of hypocrisy, Jesus' simple solution is this: Don't let anyone see what you are doing.
This doesn't conflict with Christ's recent teaching about letting good works shine out like light in the world (Matthew 5:16). These are compatible, mutually balancing statements. It's good for the world to see Christians acting in love, when those acts demonstrate the love of God. Those acts are not good when the Christian acts "in order to" be praised by other people.