The definition of merit varies among Islamic worldview and modern world.
Today we define merit as success, fame and productivity. However, in Islam success does not lie in fame rather fame reduces your chances of being successful with God.
Spiritual productivity and material productivity are parallel domains. I know a few individuals who manage to be productive in both domains but many times these modes of productivity are anti parallel leading to compromise rather than synergy.
Our eternal worth and self actualized worth may be different. The idea of filthy rags can be over pessimistic if it reduces spiritual productivity. The actual intent of that idea is to not have over reliance on productivity but to seek supernatural grace and intervention.