Jesus calls His followers to a humble righteousness, not a pompous, arrogant, prideful religiosity. Though the scribes and Pharisees lived their good works in such a way as to declare them to the world, for Jesus' followers it was never to be this way.
Kingdom citizens were still to be as they were described in the beatitudes (5:3-12), poor in spirit, those who mourn over sin and injustice, and those who are meek and lowly like their Savior.
Jesus never told His people not to do good works, or to never be seen publicly doing good works. Rather, it was the principle of humility, first in the heart, and then working through our efforts to glorify God, that was to control our daily walk and service in the church.