If the pilot needs to leave the cockpit it logically follows that he must open the door from the cockpit to do so. I suspect that in the land that follows the 9/11 excuse this means the seat belt sign must be turned on lest any of the terry wrists seize control of the cockpit in the period between him leaving and returning.
It is called security ( it actually has nothing to do with real security but hey welcome to modern America comrade)