Matthew 6 speaks of having a humble faith. The Lord already knows our needs and what’s on our heart. Doing faith for recognition from others, or boasting about it, is not humbling ourselves before the Lord.
Again, the Lord is speaking of the heart, or the motivations of man. That is the root of our trouble. Charity is not so others can recognize what we are giving. Giving is for those that we give to and to recognize that all is given by our Father.
“Take heed that you do not do your charitable deeds before men, to be seen by them. Otherwise you have no reward from your Father in heaven. Therefore, when you do a charitable deed, do not sound a trumpet before you as the hypocrites do in the synagogues and in the streets, that they may have glory from men. Assuredly, I say to you, they have their reward. But when you do a charitable deed, do not let your left hand know what your right hand is doing, that your charitable deed may be in secret; and your Father who sees in secret will Himself reward you openly. “And when you pray, you shall not be like the hypocrites. For they love to pray standing in the synagogues and on the corners of the streets, that they may be seen by men. Assuredly, I say to you, they have their reward. But you, when you pray, go into your room, and when you have shut your door, pray to your Father who is in the secret place; and your Father who sees in secret will reward you openly. And when you pray, do not use vain repetitions as the heathen do. For they think that they will be heard for their many words. “Therefore do not be like them. For your Father knows the things you have need of before you ask Him. Matthew 6:1-8 NKJV