Facing away from the door (I.e. having the door in the back) makes some people anxious, like people usually turn and face the door in an elevator. That’s why a hotel bed often faces the door.
The position relative to the window is a question of light.