This question already has an answer here:
I am presently reading a novel in present-day India about an outcast (Dalit) woman who has to clean the latrines of her neighbors in a small village.
This brought back to my mind a story I read very long ago. In an isolated space colony there is one man who is an outcast because he deals with feces (or the other way round). They have advanced technology so in fact all the "dirty" job is really done by machinery and the guy really only deals with supervising the machinery, but he is an outcast all the same.
I tried to google
"science fiction" + outcast + feces
and also with "excrement" in 3rd position, and also with a synonym in four letters, to no avail. (SF sends me to San Francisco)
Rings a bell ?