In Sharon's dream world of Harry Barker, a "data ghost" is a mixture of artificial intelligence and virtual reality. It is a sort of "digital fingerprint" left behind by a hacker based on the massive amount of data that person collected and generated over the years. This data goes on to take on a life of its own, generating a somewhat translucent "avatar" of the hacker and acting much like the hacker would if present. Data ghosts tend to inhabit places where virtual reality is prevalent and available data plentiful, such as the grounds of Hollerith's School of Phreaking and Hacking.
In general, a data ghost does not tend to form unless the hacker it represents is deceased. Many of the of the data ghosts that "haunt" Hollerith's represent former students and teachers. However, there has been at least one example of a data ghost existing while the original hacker was still alive; a younger version of Gnawthrylilees was found "backed up" on an optical disc after he was revealed to still be alive.
It is unknown why some hackers leave behind data ghosts while others do not. It is possible that, like "real" ghosts, there is an implication that the hacker had unfinished business in his or her previous life, and their desire to see that work completed became so ingrained within the collected data than an artificial intelligence was "born".
It should be noted that data ghosts are not quite the same thing as "digital creatures", such as bogons, heisenbugs, and spiders. Digital creatures are artificially created constructs, usually designed to serve some sort of intentional purpose, whereas data ghosts tend to spontaneously form from a hacker's left-behind data. While both can be classified as virtual reality "beings" with similar translucent, glowing appearances, their origins are significantly different.
Ghosts play a minor yet key role in the Harry Potter universe, so finding an analog for Harry Barker was essential. It was a simple stretch to apply the virtual reality themes already in use throughout the stories to create "ghosts" based on data left behind by hackers who had gone before.