Castle McDuck in Disney's Donald Duck and Uncle Scrooge comics: When first introduced in Carl Barks' "The Old Castle's Secret," it was purportedly haunted by the ghost of Sir Quackly McDuck, who sealed himself in its walls along with a chest full of treasure. In Don Rosa's comics, it's apparently haunted by every member of the McDuck clan, who watch over their descendants and help scare off enemies; Sir Quackly is the one who shows himself the most often. There was also a Scooby-Doo Hoax launched by their rival clan the Whiskervilles involving a ghostly hound.
Rueben Rueben, from Zip Comics, stumbled on a haunted castle with benevolent ghosts who gave him powers.
Doctor Doom's castle in Latvaria. The only monster is the human monster of Doctor Doom.
The ensemble comedy High Spirits (1988) was set in a haunted castle.
Van Helsing plays this straight but also kind of lampshades it since the whole movie is a deliberate mash-up/tribute to Universal Horror Classics.
"Manos" The Hands of Fate played this exact trope, except they couldn't get a castle, so they used a smallish and rather boring house.
Castle of Blood depicts Edgar Allan Poe being challenged to reveal the inspiration of his stories. Big mistake—it leads to a night in a haunted castle. The film claims to be based on a story of the real Poe but nothing he wrote in our world really fits the bill. The movie was remade in 1971, titled Web of the Spider and was allegedly based on Poe's famous story Night of the Living Dead. Uh, yeah.
Many of Vincent Price's movies were set in haunted (or supposedly haunted) castles, The Pit and the Pendulum probably being the best example. Although P&P was directed by Roger Corman, other of Price's vehicles were directed by William Castle.
Bram Stoker's Dracula, of course. Dracula greets Jonathan Harker: "Welcome to my house! Enter freely and of your own will!"
Played with in the Discworld novel Carpe Jugulum, where the ancestral Uberwaldean home of the Magpyrs is actually called Dontgonearthe Castle, and the Old Count would advertise it as if it were a tourist trap using Reverse Psychology ("Last Chance to Not Go Near The Castle").
And it worked. People would come in for MILES just so they could Notgonearthe castle. And when, every few decades, the vampire there rose again (and was quickly quelled, of course), it just added to the interest... and the local economy. It helps even more that there's something with the roads that causes all traveling coaches to break a wheel as they near it.
Present in Christopher Stasheff's novel The Warlock's Companion; it's the location where half the story takes place. The other half is flashbacks, including one that plays with the trope by referring to an ancestor a few centuries ago who, seeing that haunted houses were becoming all the rage, but owning only a fairly recent mansion, instructed the house butler/majordomo to go out and buy an ancestral ghost from somewhere.
In James Thurber's The 13 Clocks, the Duke finds his castle haunted by the children he locked in the tower: that is, he hears their laughter, and children's balls come bouncing down the stairs. Cold as he is, he finds this more horrifying than the ordinary sort of ghosts.
The neo-Gothic Wyrdhurst Hall in Aunt Dimity Beats the Devil. It comes complete with local villagers who tell visitors the place is haunted.
Harrenhal has this reputation in A Song of Ice and Fire, partially because the Targaryens used dragons to roast the castle's holders alive centuries ago, and partially because most of the people who hold the castle end up experiencing misfortune ( Janos Slynt got sent up to join the Night's Watch, Amory Lorch got thrown in the bear pit when the castle was taken, Vargo Hoat had his limbs chopped off and fed to him by Gregor Clegane, and so on).
Harry Potter: Hogwarts Castle is a unique form of this trope: the castle is indeed haunted by several ghosts, but most are perfectly nice (well, except Peeves, but he's a pest rather than an actual threat), and the castle is, of course, also a school. Most of the ghosts just hang around and give advice when asked, but one of them is actually teaching classes, and no-one's sure if he's even noticed he died.
Septimus Heap: The Palace is inhabited by mostly benign ghosts and has a generally run-down appearance, also because the Heap family is too small for it.
A few pop up in the Middle-earth works of J. R. R. Tolkien: Minas Morgul and Dol Guldur in the Third Age (both literally haunted, being the lairs of the Ringwraiths and the Necromancer respectively) and in the First Age, when Sauron captures Minas Tirith (no, not the one in Gondor) on Tol Sirion, and turns it into Tol-in-Gaurhoth (the Isle of Werewolves) with a similar reputation for unquiet souls.
Subverted and played for laughs in an episode of the Canadian reality series Kenny Vs. Spenny. The two title characters have a competition to see who can stay inside an abandoned house the longest without getting scared. Kenny (the member of the duo that always cheats) tries a number of tactics to scare his friend Spenny, who's easily manipulated. In the end, Kenny is spooked out of the house by a loud noise, which he believed to be a ghost. It was actually a construction crane that fell on the house, making Spenny win the competition.
Dungeons & Dragons has too many examples to list, but the Ravenloft campaign is setting is especially full of them, due to its Gothic horror inspirations. Most notable is Castle Ravenloft, after which the setting is named.
Fighting your way through such castles is the very premise of the Castlevania series. In fact, Haunted Castle is the actual title of one of the arcade games in the series.
Keith's castle in Shadow Hearts is both a straight example and a subversion. It is haunted, as is only appropriate for a castle owned by a vampire, but the owner himself is a very nice guy; all the real trouble in the area is being caused by the mayor of nearby Bistriz.
The gothic Castle in Amnesia: The Dark Descent is located in thick Prussian forests which the locals are afraid to enter as it is supposedly haunted by the deserters of wars. And that's before the Shadow shows up...
Soldier's Peak, the former headquarters of the Grey Warden Order in Ferelden as seen in the Warden's Keep DLC expansion for Dragon Age: Origins. It's an abandoned fortress inhabited by roaming undead, demons, ghosts and a centuries-old blood mage, trying desperately to hold back a demonic invasion from the Fade.
The Adamant Fortress mentioned in Asunder, a Grey Warden outpost built into the side of the Abyssal Rift, a chasm believed to lead right down to the Deep Roads. After being abandoned by the Wardens, it fell under the control of the Tranquil Pharamond, who's experiments accidentally tore the Veil, leading to every building but the Keep being burnt to the ground, the inhabitants killed and their corpses possessed by demons.
Mundus's castle in the first Devil May Cry. Dante's not spooked easily, but the place is filled with eerie contraptions and horrific demons.
Fatal Frame features Himuro Mansion for the first game and the Mansion of Sleep for the third. Both are big. Both are spooky. Both are designed to make sure you never come out again, dead or alive.
The ruins of New Londo in Dark Souls, the remains of a once-great city flooded to seal away the Darkwraiths. It's now filled with ghosts, who are quite nasty,requiring the player to either be cursed or use special weapons to hurt them.
Almia Castle from Pokťmon Rangers: Shadows of Almia is completely devoid of human life and crawling with ghost and psychic type pokemon. It's also covered in ice.
Hang Castle in Sonic Heroes is filled with pumpkin-headed ghosts and robotic wizards and witches and sprawls out as far as the eye can see. The following stage, Mystic Mansion, is set on the inside, with the final area on the roof at dawn, having survived the many traps within. The reason Sonic is here is because he's spotted a Chaos Emerald in the castle.
Girl Genius has Castle Heterodyne. The ruined steampunk castle may not actually be haunted, but it's stuffed full of deathtraps, and its broken artificial intelligence tends to kill the people who enter, and/or press-gangs them into repairing it.
Grave Academy, while not a comic per se, it is a Forum/RPG, that centers on a school for monsters which is based in such a castle.
Bender's uncle Vlad's castle in the Futurama episode "The Honking". Near the village of Thermostadt, it was "haunted" by holograms of his dead ancestors.
And, of course, many adventures of Scooby-Doo and friends.
Richard Tyler in The Pagemaster has to go through Dr. Jekyll's 'spooky' mansion (complete with dark clouds, lightning, bats, a full moon, and a kind of gravestone in the front saying that it belongs to him).
The Beast's castle in Beauty and the Beast. As the Beast gradually gets nicer, the action takes us further and further into the section of the castle that has pretty neo-classical architecture, until the curse is cured at the end and the whole building is like that.
Castle Wyvern in Gargoyles has this reputation, although we never see any ghosts in the castle itself.
Given that castles' whole purpose was to provide strongholds for military authority, the abundance of ghost stories which arise from their typically bloody histories is hardly a surprise.
Windsor Castle is supposed to be haunted by the sad and shabby ghost of King George III who spent his last years there chatting up the shrubbery under the impression it was brother monarchs and being tormented by the doctors trying to cure him. And the ghost of Queen Elizabeth I still briskly walks the gallery she built for exercise on rainy days which is now the library.
The Tower of London is even more haunted for obvious reasons. The murdered princes Edward V and Richard Duke of York are seen playing around the White Tower, the headless ghost of Anne Boleyn stalks the halls terrifying the Yeoman Warders and so on.
Scotland is full of them. Most Scottish castles seem to have at least one ghost, though three standouts are Edinburgh, Glamis and Fyvie. Here is a very incomplete list.
The Kremlin is no less fun, being perhaps the one castle in Europe with the bloodiest history. The ghost of Ivan the Terrible is said to appear before terrible catastrophes; two last alleged sightings are before Red October and just before WWII. Other recognizable ghosts in these stories are of Pseudo-Demetrius (last sighting: just before the fall of the Union), the ill-fated Tsar Boris Godunov, Nikolay Yezhov (the Peoples' Commissar of NKVD, who enacted the Great Purge of 1937-1939), Fanny Kaplan (Lenin's assassin) and Lenin himself. The oldest ghost allegedly seen in the Kremlin is the medieval prince Ivan the Moneybag, and the youngest is Marshal of the Union Sergey Akhromeev, who committed suicide there during the fall of the Union (1991).