From a modern point of view, it is not appropriate to open the door for the bed. When people are sleeping in it, it is not elegant to open the door and let others in.
However, it is also a way to save space in schools or crowded houses. Such as school dormitories, construction site dormitories and so on.
In your own home, if the area is not particularly cramped, it is recommended to put the porch bed horizontally, which is more elegant.