"Go therefore, and make disciples of all nations baptizing them in the name of the Father and of the Son and of the Holy Spirit, and teaching them to obey everything I have commanded you. And surely I am with you always, to the very end of the age.”
Matthew 6:1-6 is speaking on the Pharisees. They would go into the streets and pray loudly, to show how righteous they were, and they were "better" than the common folk.
Jesus does not want us to have a superiority complex, or to flex how much more "righteous" we are.