Normally, when you buy a house in New York, the doctrine of caveat emptor applies. This means that the seller is supposed to tell you anything that could possibly go wrong with the property and then you make a decision whether to buy or not. If there are any major issues, and they were disclosed, they don't provide grounds for any type of legal action on the side of the buyer.
However, the law can get very murky with regards to hauntings. This is, of course, because proving a house is haunted isn't something that can be proven easily. It's not a defect of the house, per se. However, the New York supreme court allowed a buyer to rescind his contract because he wasn't told his house was haunted when he bought it.
The facts were these: Jeffrey Stambovsky bought a house from Helen Ackley and Ellis Realty. The house had quite a reputation in Nyack, New York for being haunted. It was part of a haunted tour and Ackley had many stories about the ghosts. Ackley claimed that the ghost left gifts of baby rings, and then, later, they disappeared again. She also claimed that a ghost shook her bed to wake her up in the morning.
The court decided that in this case, the house's value was greatly affected due of its reputation as being haunted. Because of this, they said, Stambovsky could rescind his contract and not buy the house anymore, despite the fact that he'd signed a contract already. It was important information that was withheld, and a such, grounds to terminate the contract.