Assuming I'm not missing an obvious joke (totally possible; I have low Insight), it's just a matter of spacing on a grid. Just as a small or medium creature doesn't take up the entire 5 ft space, a door is just 3 ft wide with a frame (or two 3 ft wide doors), and the rest is still just wall. Similarly a bed is slightly larger than a 5 ft space, so it takes up a 10 ft square, without filling up the entire space.In DnD, a door is 5 feet wide, a double door 10 feet.
A bed is 10 feet long, and 5 feet wide.
Why is this?