6:1 “Beware of practicing your piety before others in order to be seen by them; for then you have no reward from your Father in heaven.
See notes from John Gill
The point here, I believe, which sets the tone for the teaching to follow, is this: “Who is your intended audience when you do ‘acts of piety’?” If your goal is to get recognition from people around you, then that is the only recognition that you will receive. If you are not concerned with recognition from others, but desiring only to please God, then if others see your good works, you may indeed serve to draw them toward the Father (Mt 5:16).
“PIETY” – the Greek work here is “righteousness” and refers generally to the state of being in right relationship with God. “Practicing righteousness” suggests outward expressions of our inward attitude, spirit, and state of relationship with God.
Jesus then works through specifically 3 different forms of piety: giving alms to the poor, prayer, and fasting. Each of these was foundational to the Jewish understanding of outward expressions of inner righteousness – Jesus never had to say, “You should do these things.” Everyone knew to do them. The problem some were having was the attitude with which they did them, and their interest in being seen and approved by others for them.
A related passage is found in Matthew 23.