Earlier quoted context omitted.
There are potentially other carrots aside from material wealth that can motivate people to do unpleasant work. Currently it takes significant pay to get people to do certain important but thankless jobs. We could thank them. A legacy is important to many people. They may enjoy an immutable commemoration of their work, if they're secure in a material sense.
This is the exact same answer every leftist I've talked to says when I ask them who will run the garbage system, and who will clean the sewers.
Cleaning the sewers sounds objectionable. I think you shouldn't discount the idea that in a societal structure that's different from ours you'd remove some of the social stigma that comes from such a job. But at the same time, if you observed that very very few people wanted to clean sewers for whatever reason, and there wasn't enough supply to meet demand, then you invest more in technology that reduces the shortfall. As others suggested, automation.