The Bible says, But we are all like an unclean thing, And all our righteousnesses are like filthy rags; We all fade as a leaf, And our iniquities, like the wind, Have taken us away.
Isaiah 64:6 NKJV
The above scripture showed us that in our highest moral status, we are still unclean in the sight of God. Every self-righteousness of man cannot measure up to His righteousness. As far as God is concerned, with our default fallen nature, everything we do cannot simply measure up to His high moral standards.
To show us the seriousness of this, the Bible told us the story of Cornelius the centurion. Even though he was a devout man who feared God, his works were not enough. His almsgiving and charity, could not simply save him. God had to send Peter to him so that he can have the righteousness that comes through Christ (Read Acts 10).