I’ve always found the topic interesting since I have great respect for human traditions that are universally attested throughout all of human history, as ghosts are. At the same time, I find it fascinating that the Church is, in its doctrine, resolutely quiet on the matter. It’s one of the many broad areas of human experience where the Church is open to mystery and does not attempt to make any hard and fast pronouncements. She, of course, warns against attempting to summon the dead. But she says nothing, so far as I know, for or against the idea that the dead may, on occasion, be allowed to visit us. She warns against over-credulity in such matters, and also cautions that Satan can appear as a angel of light, but there also seems to be room in the Tradition for the possibility that hauntings (presumably by souls in Purgatory like Dincocrates) can occur (as there is emphatically room in the Tradition that saints in glory can appear on occasion).
I don’t really know what to make of it, and have often wondered if some theologian has ever considered the matter.