People don't like feeling that they don't know things and can't influence things.
The true answer to things is often complicated and requires a high investment for comprehension.
Ghosts imitate concepts people already know and play into cognitive biases like false positive bias and anthropomorphic bias, etc...
EDIT: I should add that ghosts are an ancient idea (probably due to us not having a realistic idea of much of anything back in the day) and have remained a failure popular one. That means it is also an inherited idea. People don't just invent the idea of ghosts on their own, the draw it from the culture, the culture keeps it alive.