What does Matthew 6:17 mean?
Jesus has again called out some of Israel's religious leaders as hypocrites. Many of their religious practices are merely performances to earn the praise of other people (Matthew 6:1–5). This time, the worship practice is fasting: abstaining from something, usually food, in order to focus on worship, prayer, or confession to God. To make sure everyone knows they are fasting, these men would walk around looking "gloomy" and twisting up their faces in some way. Since all they care about is the praise of others, that is all their fasting will get for them (Matthew 6:16).Jesus is not condemning fasting. It was commanded in the law of Moses (Leviticus 23:27–32). His earliest disciples and followers were primarily observant Jewish people. Christ assumes they will participate in the worshipful practice of fasting. Many Christians continue to practice fasting as part of genuine worship, confession, and making requests of God.
What Christ is condemning is fasting that's insincere. In chapter 5, Jesus gave many examples which showed that inner thoughts and attitudes could be sins, as much as words and actions. Here, he continues to show that even good actions cannot be truly righteous unless they come from pure motives. Jesus said it matters how we worship, however.
So, when a believer chooses to fast, they should do it without announcing it. That doesn't mean no one, at all, can know. It simply means Christians shouldn't advertise their fast. The Pharisees apparently skipped their normal grooming on days when they would fast. They didn't wash their faces or put the normal oil on their heads. They were making a show out of their fast, so other people would see how much they were suffering.
Jesus tells His followers not to put on those artificial signs—to not deliberately call attention to their fasting. Fasting should not be motivated by the praise of other people.