Are there examples of menial jobs in the Star Trek universe? I would imagine by then there simply are no menial jobs. I'm not sure what menial job examples there are that can't be automated.
The jobs left over are interesting jobs. I'd imagine the motivation to do so are on par with the same motivation to get a phd. Few people get phds solely to get better job prospects, but rather do it for personal enlightenment and passion.
Also the same goes for the infinitely wealthy. If you accumulate billions of dollars and die donating those billions to charity, you weren't motivated solely to have more wealth, but something greater than that.