The castle is the first royal building you get in the game. In fact, after rescuing Magnus from his crystal, it's the second thing you do. Claiming the castle is as simple as dragging the on-screen wand onto it. For doing this you receive not only the castle building, but also 1 experience point (XP).

The castle serves one main function in the game; it's where you will find knights, once you reach the stage where knights are available to you. In reality, you don't even need to click on the castle to know whether you have a knight available; if you do, the knight will be visible standing guard outside the castle.

It is also possible to see a list of all of the heroes you have available by clicking on the castle, though this is also easily seen when you are at a place of legend and deciding which heroes to send on an adventure.

The top tab (once in the castle) gives you very, very basic instructions on how to play the game.

Castleville Legends Wiki