Many episodes touched on that. Naturally, the value of a person's time sharply rises where no one need give their time. Today there are still vast differences in personalities among people that generates incredible variance in culture and pursuits irrespective of reward. Conjecture that to the maximum. There are things that give incentive to pull away from what one might not ordinarily do. There's specialty teaching; personal performances; lively forms of artistry; types of manual labor for odds and ends not conducive to androids and automation; the never-ending pursuit of happiness and/or power? What might "dirty work" be? It's like thinking of an amalgamation of the present day considerations of elite society equalized through sheer unrestricted access of the masses. I forget how land settlement on Earth works in Star Trek.
No matter the economics...
One might expect that most societies comprised of Earthlings will still start with the world's oldest profession and end with the world's second-oldest profession.