Ghost stories belong to the genre called horror literature, whose purpose is to scare the reader with situations that cause horror or fear. The most common technique is suspense, the slow insinuating of a doubt or of a frightening revelation, which keeps the reader interested.
This story can be defined an inverted ghost story, because a lot of elements are different from the traditional ones. The main difference is the fact that Mr Otis is not scared by the ghost, while usually people should be. Moreover, the Ghost itself is frightened by the Otis twins.
There is also comic relief bordering on farce, including buckets of water balanced on half-open doors. But the story has a dark centre. The crime and retribution which led to the haunting is ghastly, and this is really not a comedy at all, but a tale of redemption through the power of love. The innocent girl of the family, appropriately called Virginia, prays for the ghost and endures terrifying if unnamed experiences to release the ghost.
Also, The Canterville Ghost is both a parody of the traditional ghost story and a satire of the American way of life. Wilde obviously intends to satirize American materialism, but he pokes fun at English traditional culture as well.