Before the events of Twilight Princess, the palace was the home of the Royal family. During the time in which princess Midna was ruling however, Zant usurped the throne and became the false king.
Zant's ReignDuring the reign of Zant, he turned the castle into a fearsome palace filled with his ghastly creations. He then stole the two Light orbs (sols) and hid them in the east and west wings of his castle, turning the Twili into horrifying beasts. To protect these magical orbs he set up multiple defenses including; Giant animated versions of his mask, twilight fog, many shadow beasts, a phantom of him (one for each sol) and if all else fails a cursed hand that will stop at nothing to get back the sol once it's been stolen. Zant himself resides in the throne room at the end of the central part of the castle.
Despite all the challenges, Link managed to steal back the sols, and reverse the curse on the Twili. Link then uses a sol infused Master Sword to hunt down Zant. After the battle, Midna kills Zant and they leave the castle.
It is unknown what happened to the castle after the events of Twilight Princess, but it may be assumed that Midna resided in it being the true royal.