Minecraft wiki entry for Bed, associated text: When choosing where to respawn the player, the northwesternmost (lowest X- and Z-coordinates) location of the seven blocks adjacent to the head of the bed is chosen first. If this location is obstructed, the next choice is to its south (+Z), rather than the east (+X). Only when all seven locations around the head are obstructed are the three remaining ones adjacent to the foot then to be considered.