Anyway, what I did was to uncheck the "Public Area" tag. Then I changed the AI package of the guards that are there during the day so that they unlock the doors while on duty (the night guards already have a package that locks the doors). Since they belong to the Castle faction and the cell belongs to that faction, I thought this would mean that the castle would be accessible during the day - just like a merchant's shop.
That didn't work out, however. Entering the great hall is now always considered trespassing.
What did I miss? As far as I know, none of the other NPCs inside the castle have any packages that make them lock the doors when they're in the great hall, so I'm a little bit puzzled.