I think you are missing the point
Mat 6:1 "Be careful not to display your righteousness
merely to be seen by people. Otherwise you have no reward with your Father in heaven.
Mat 6:2 Thus whenever you do charitable giving,
do not blow a trumpet before you, as the hypocrites do in synagogues and on streets so that people will praise them. I tell you the truth, they have their reward.
Mat 6:3 But when you do your giving, do not let your left hand know what your right hand is doing,
Mat 6:4 so that your gift may be in secret. And your Father, who sees in secret, will reward you.
Jesus is not saying you have to sneak around and covertly give an offering to your local church so nobody knows.
He was talking about charitable giving and announcing it to everyone.."Look at me! I am giving 10000 dollars to help feed poor orphans. Aren't I righteous?"