The King James version translates this verse saying, “Our righteousness is as flighty rags.”
The word translated there as “filthy rags” literally means, “menstrual cloth.” Forgive my bluntness but God says the best thing you have ever done, apart from Him, stinks like that. When we do things, when we help others, isn’t there sometimes some pride mixed in with our motives? Don’t we sometimes help people because we want them to owe us, or because we want people to know how good we are, or because we are people pleasers? We serve with mixed emotions. Now, if the best we can do stinks like that to God, how do you think your intentional sin smells to Him?