"Filthy rags" is from a different context, but that is correct what you intend to say: good works are not done for any other reason than love of God and one's neighbor.
Only the works of one that is saved can be good
Based on what scripture?
one thing is wanting to thee: sell all whatever thou hast, and give to the poor, and thou shalt have treasure in heaven: and come, follow me (Luke 18:22)
Observe: the young man was not saved, but that what he did is good. It just was not enough. The same episode promises salvation to anyone who "hath left house, or parents, or brethren, or wife, or children, for the kingdom of God's sake". So these things are good even before the doers of these things are saved.
Yes, the young man was not saved, because he lacked faith in Jesus Christ as Savior. He thought he was perfect and could go to heaven because he was. When Jesus pointed out his weakness - his wealth - he showed him that his perceived perfection was never going to be enough. Note also that Jesus didn't say to him that if he gave everything to the poor and followed him, he would be saved, but that "his reward would be great in heaven". There is a difference. The base of our faith is that Jesus Christ is the one and only Savior and we should not allow anything in our lives - family, love, money, fame - to keep us from following him.