The show generally portrays Harry's appearences to Dexter as being a representation of Dexter's memories and subconsciousness, rather than a supernatural occurence of any kind. Some support for this statement:
- Dexter never treats Harry's appearances as odd or strange; he doesn't think of himself as being haunted nor insane. Hence the appearances are more representational than literal.
- The show has never ventured into the supernatural in any other way. Dexter's setting is realistic, with no supernatural elements lacking a mundane explanation. (Sometime events are fortuitous or even miraculous, and this ties in with characters' faith, and some characters believe in supernatural elements. But the setting itself remains mundane.) Hence seeing Harry as a "real" ghost would be extremely out of place.
- The show has repeatedly and unsubtly implied that Harry is a figment of Dexter's subconsciousness - see, e.g., the season 6 episodes "Just Let Go" and "Nebraska," when Dexter considers himself lost to the Dark Passanger, and Harry's ghost is replaced with Brian's, urging him to murder and callousness instead of Harry's well-ingrained philosophy.
Harry really represents several sides of Dexter:
- He reminds Dexter of Harry's Code, frequently urging him to be more cautious.
- Harry remains a monumental figure in Dexter's life, whose approval he seeks despite mounting friction and disillusion. The ghost lets Dexter play that relationship out.
- Harry's goals and hopes for Dexter have been unclear; the ghost sometimes expresses what those hopes might have been, and how Harry might have reacted to Dexter's growing character. Did Harry have any hope Dexter might gain humanity and compassion? Or did he prefer him as a well-aimed psychopath? Harry's ghost lets both these extremes be expressed and considered.
- As a representative of Dexter's subconsciousness, Harry sometimes knows "clues" or has noticed details that conscious Dexter hasn't yet. Similarly, he can represent Dexter's "better judgement." See e.g. season 4's "Remains to Be Seen," where Dexter suffers memory loss, and Harry hints at things Dexter doesn't remember. In this role, Harry isn't really representing Harry at all - he's "just" a face for Dexter's subconsciousness.
I do feel that after season 4, one of the (many) changes in tone the series took has been to treat Harry's ghost as more of a character in his own right. He's present more, and it's harder to explain some of his behavior as originating from Dexter. Take, for example, the season 5 primiere "My Bad," where Dexter's rage eventually prompts him to murder a random bully in an isolated restroom. Harry's ghost says "That's the first human thing I've seen you do since she died," which seems impossible to attribute either to Dexter himself (his own humanity hardly seems to be a concern of his at the moment) nor to Harry (who would never have condoned the murder of someone who wasn't a serial killer, certainly not one so careless and serving merely to let out pressure). If such cases become more frequent and more clear-cut, there might be room to argue that Harry's ghost is something more than a figment of Dexter's imagination. At the moment, I don't see that coming across very strongly, and I really wouldn't attribute it to anything more than local cases of sloppy writing.