It is a type that's characterized for having few amounts of Pokémon and moves, also because its Pokémon tend to have low HP. In battles, this type is useful because it's the only type that has two immunities, Normal and Fighting, and its common to have moves of those two types. From Generation VI onwards, they are also immune to moves and abilities that prevent the Pokémon from escaping, like Block and Shadow Tag.
The Pokémon of this type are usually related to fear, dark and the afterlife. They usually live in abandoned houses, cemeteries, funeral places and inhabited and dark places. Also Ghost-type Pokémon tend to be extremely naughty, pranking on humans just to see their faces and reactions. A curious thing is that if the human is more scared, more power the Pokémon it will have to prank with it. At worst, some Ghost type Pokemon may have relatively murderous behaviors, such as Jellicent with their preying on ships and their crews. Or the Litwick evolutionary family, with their behaviours of draining energy from lost people.
They're strong against the Psychic type because some people are afraid of ghosts, and fears affect the mind, just as the Bug type. Communing with ghosts is also said to be of a much different process than simply reading minds through physical and empirical means.
They're strong against themselves because there's a belief that the strongest spirit wins, referring to the spirit to the desire to win something.
They're weak against the Dark type because dark represents terror and evil, and they say that evil spirits (like Spiritomb) are punished. In some beliefs, ghosts who lead evil lives and refuse to go to the afterlife are said to transform into demons, and demons in some mythologies are feared to eat lost souls.
They're immune against the Fighting and Normal types because spirits are incorporeal beings, thus can't be hit normally. This is also the reason why the Normal type is immune to them, because a mortal and a ghost can't hurt each other. Interestingly, the Fighting type is not immune to them.
They resist the Poison type because you can't poison someone who's already dead.