(I've included the video below for the interested, but first the obligatory warning: it's a little over two hours, and streaming elfgames is somewhat different in format than what you might be used to doing at the table. People who produce RPG content for the camera tend to make more linear stories, and their players bring a little less mayhem than normal. The one below isn't a livestream, so it even has multiple cameras and editing!)
(Also, in case it needs to be said: this post represents my view on ghosts. If you like your restless dead, ghosts-as-the-looming-spectre-of-death, keep liking them!)
But anyway, thinking about ghosts. I often think of ghosts as being boring, but that doesn't quite strike at the heart of the matter. (Chuck Wendig has an old post about hating seafood until he encountered good seafood, and I think that applies here.) A lot of authors use ghosts as yet another weird monster or bit of set dressing, a spooky, incorporeal antagonist to be exorcised by the end of the story, which seems like low-hanging fruit. Once you've encountered one or two hauntings, you know the typical schtick: the monster's vague hints and warnings get increasingly dire until they become physically dangerous, and then the protagonists somehow exorcise the ghost from the place.
(That's probably also a critique of lazy storytelling in general: I love vampires, but I've watched a lot of bad vampire movies. It's clear that the guy just said, "Let's add a vampire!" with no real thought as to why they're doing it. So it is with ghosts. You can't just press the ghost button and hope spookiness falls out.)
Many authors smarter than I have devoted wordcount to how monsters mean things, but that symbolic language isn't precisely universal. Vampires represent the fear of rape, except that they used to represent disease before Carmilla and Dracula made vampires sexy rather than gross. (And that ultimately led to modern variants such as vampire-as-ultra-capitalist or vampire-as-sexpot. Symbolism is weird.) Zombies and revenants used to be the fear of disappointing our ancestors or retribution beyond the grave, but now they're the pestilential dead, or widespread ignorance made manifest. Werewolves are anxieties about the wilderness, but they also represent fears about the sociopaths who lurk among us, but they might also be potent warriors in some of the older tales. (Fears about them might represent old soldiers with PTSD, maybe?)
In that schema, one might expect the traditional role of the ghost is to remind us all of mortality and the debt we owe to our ancestors. But I tend not to find the first particularly frightening. (Aren't most monsters ultimately tied up in the fear of death? That really encroaches on the ghost's niche, doesn't it?) The second part — the ghost-as-tie-to-the-ancestors — seems infinitely more interesting.
Ghosts are typically created when something tragic happens, cursed to wander until the wrong is righted. Sometimes that just means that their deaths went unacknowledged, but it usually means that something bad happened. Ghosts, then, are the ancestors calling out to the modern era for justice.
Ghosts are forensic evidence.
I've previously discussed the possibilities of old epochs interacting with our own, and the fact that it's a recurring subject suggests that I dig my D&D flavored with sad geologic time à la Patrick Stuart. (I do.) But in this schema, ghosts aren't scary monsters to fight so much as the remaining thread of evidence that something terrible has occurred.
In stories, that usually means that ghosts are terrifying until you figure out what they want — you often start out thinking it's a traditional ghost story until the reveal that the ghost just wants you to solve its murder. (Wasn't there an entire subgenre of psychic detective shows in the mid-2000s?)
In RPGs, that means ghosts are puzzles to be solved. More importantly for a game in which you sit around a table talking to each other, ghosts mean you can talk to the evidence. That means they can tell you things standard forensic evidence can't: thoughts, feelings, names. Conversations also tend to stick in the memory in a way descriptions don't: a list of facts is going to be hard to remember without writing it down, but you'll probably remember the flow of a conversation, even if it's a little weird. Plus, a ghost describing its own murder is probably more memorable than just coming across a body with no personalization.
(Another reason why RPGs are great: there are often multiple ways to deal with ghosts. Low-powered characters have to deal with ghosts on their own terms and unravel the puzzle of their existence. High-powered parties can always resort to punching ghosts, or using magic to lay them to rest, or whatever recourse they have. Any good RPG usually has a couple of different games hidden in its matrix.)
You can never really give away too much information as a GM, but if you're worried about it, ghosts are often addled, or have facts they can't quite recall. Keep in mind all the ways that people can misremember information, or the limits of an individual's perception. (Rewatch Rashomon.)
If you're fine with restless ghosts being just another monster to fight, they can absolutely work that way, but folklore and the Monster Manual are filled with tons of monsters, including many that can go incorporeal or possess people. It seems better to play to the themes that ghosts reflect: use them to reveal ties to the past and evidence of past tragedies. Another piece of the past with which players characters can interact.
I'll leave you with a couple of examples:
The above adventure, "The Haunting of Benthem Manor," features an evil ghost that has possessed a woman whom the PCs need to contact for further information. While it culminates in a fight against the aforementioned evil ghost, the bulk of the session involves going around the house solving puzzles and talking to the ghosts of other victims.
James Maliszewski's The Cursed Chateau takes a similar tactic, hiding many of the clues regarding the house's history among the (ghostly) household staff. Of course, since the ghosts are all mad, interacting with them is... unpredictable.
The protagonist in Crimson Peak surmises (correctly) the apparitions tormenting her are actually trying to warn her of the danger in the titular manor. (For that matter, it appears the dead have some knowledge of the future, as they try to warn her about it long before she ever goes there.)