The words “all our righteousnesses are as filthy rags” come from Isaiah 64:6 which in it’s entirety says the following:
But we are all as an unclean thing, and all our righteousnesses are as filthy rags; and we all do fade as a leaf; and our iniquities, like the wind, have taken us away.
Unfortunately this scripture has often been cited to support the unhealthy Calvinist doctrine of total depravity, even though Isaiah did not say this as a theological statement about about the individual good works of every person.
Isaiah’s words had to do with the nation of Israel who had forsaken their covenant with God.
In Isaiah chapter 1, God says the following through the prophet Isaiah: Come now, and let us reason together, saith the Lord: though your sins be as scarlet, they shall be as white as snow; though they be red like crimson, they shall be as wool. If ye be willing and obedient, ye shall eat the good of the land: But if ye refuse and rebel, ye shall be devoured with the sword: for the mouth of the Lord hath spoken it. How is the faithful city become an harlot! it was full of judgment; RIGHTEOUSNESS lodged in it; but now murderers (v.18-21)
Notice that God says of Jerusalem, “righteousness lodged in it, but now murders.” Israel had turned away from the Lord and that is why Isaiah says “we are all as an unclean thing, and all our righteousnesses are as filthy rags.
In fact you can see similar language in the context of Isaiah 64 as in Isaiah chapter 1.
Notice the following:
Thou meetest him that rejoiceth and WORKETH RIGHTEOUSNESS, those that remember thee in thy ways: behold, thou art wroth; FOR WE HAVE SINNED: in those is continuance, and we shall be saved. But we are all as an unclean thing, and all our righteousnesses are as filthy rags; and we all do fade as a leaf; and our iniquities, like the wind, have taken us away. And there is none that calleth upon thy name, that stirreth up himself to take hold of thee: for thou hast hid thy face from us, and hast consumed us, because of our iniquities. But now, O Lord, thou art our father; we are the clay, and thou our potter; and we all are the work of thy hand. Be not wroth very sore, O Lord, neither remember iniquity for ever: behold, see, we beseech thee, we are all thy people. Thy holy cities are a wilderness, Zion is a wilderness, Jerusalem a desolation. Our holy and our beautiful house, where our fathers praised thee, is burned up with fire: and all our pleasant things are laid waste (v.5-11).
Israel was called to serve the Lord in the beauty of holiness, and Jerusalem was to be a city on a hill wherein righteousness would dwell. However, the people of God had forsaken him and the holy city was now ruined by iniquity, and that is why Isaiah says, “all our righteousnesses are as filthy rags.”