In terms of utilitarian value, castles would of course be able to contain massive amounts of resources, machines and people. However seeing as a mud hut does well enough for both it may need a bit more. Perhaps a new type of lock called a portcullis would only be able to be constructed inside castles. This lock would be harder to break(ie: take longer, have a greater chance of failure.
Now past this I'm only dreaming but maybe once someone's broken through the portcullis, they enter a room between outside and the castle itself. While in this room they have to break down a regular old lock on a regular old door. However those inside the castles can dump oil on the members of that room if they have built a special machine and deal damage to those inside. Sieges would be ever so much fun

