"Ghosts don't exists. Even if they do, it's no excuse to throw reason to the wind and embrace mysticism and supernaturalism just because we haven't understand them YET.
If ghosts exists, they must not be feared, or revered - they must be STUDIED, their manifestation observed, their properties examined, with application of science and empircism.
Whatever useful knowledge would be applied in form of magic or technology that would allow us to better understand our hypothetical 'ghosts', interact with them, and perhaps even be adapted to use for our society.
As for the wider implications of their existence on our existence, well, let some-pony else deal with it. I'm a scientist, not a philosopher."
--- Clinical Insight, Unicorn scientist and skeptic, who investigates and debunks reputed 'haunting''s as his hobby.
Well, it's complicated, and I'm only starting to really put it together, so it got holes in it, but the gist of it is this:
Magic manifests in the form of exotic particles, let's call it thaum, which has notable properties, such as that it can alter other particles and therefore its environment, and in turn allow being able to be commanded by ponies, as a result of quantum entanglement.
Ghosts are really the copy of a pony mind (his/her collective neural-impulses) suspended in their bodies stored magic through entanglement, the information of a pony's mind somehow preserved in thaum particles, and its mere presence inducing a state of quantum superposition which keeps the mass of magic together in a coherent structure, so that after the death of the original body (and mind), the magic and copy of the mind is left behind as a 'ghost' which persists in the area for quite some time.
In essence, the ghosts is a reflection, a shade, of the original pony in life, as explained by particle physics/quantum mechanics.