This is my favorite question ever.
I've never ever thought about this. I'm gonna think hard about it right now.
I think they ejaculate. You know, ghost loads. I think maybe they spit? Like when you feel wet somewhere but it's not raining, that's probably a phantom loogie. And I think sometimes they slough off ectoplasm. We've all been spirit gooed at one time or another, am I right?
I just figured it out. If ghosts slowly steal our souls, sucking them through their over-wide black maws as we sleep, red eyes flaring in the darkness, then they must poop. They must do huge, tarry, soul poops.
What? Ghosts don't steal our souls? Well what are they for, then? Oh. They're not real? I see.
Short Answer: Real things poop. Ghosts don't poop. I must admit I am disappointed. I bet a soul poop would be super nasty. Like a KFC dump plus a baby dump, plus a used up hooker dump.