It is explained in the third book that they think the shack is haunted, the noises Lupin made when he was locked in there periodically during his school days were attributed to these spirits, and it is hinted that Dumbledore helped keep the rumor alive to prevent the villagers from going near the house
However, from what we know of ghosts in the Harry Potter world, they do not seem to be much dangerous, and in fact, possibly cannot physically interact with people at all. There are ghosts all over Hogwarts, each house has it's own ghost mascot, the only ghost that is hinted to be even remotely scary is the Bloody Baron, and even then it is only Peeves who is actually afraid of him (the books make it sound like the students would not want to cross the Baron in the same way they wouldn't want to cross a grumpy old man, but not because he is scary as a ghost). The only thing close to a ghost that the students should be worried about in Hogwarts is Peeves himself, and he's more annoying than dangerous or scary. Moreover, in the Harry Potter world he's not even a ghost, as poltergeists and ghosts are classified differently. There is a ghoul living right in the Weasley's attic who no one seems to care about, and a vampire was casually allowed to be in Professor Slughorn's party during the Half Blood Prince. The only traditional monsters that the wizards are actually worried about are giants and werewolves, but I don't think a place that is taken over by a giant or werewolf is called 'haunted', even in the Harry Potter world. The wizards seem to be more scared of magical beasts such as dementors, manticores, threstals, etc.
So why exactly are the villagers in Hogsmeade afraid of the Shrieking Shack? Presumably they are all wizards so should know how to defend themselves. When it says the Shrieking Shack is 'haunted', does it mean it is infested by something more dangerous than a ghost?