This is mainly for health and safety reasons - that way the hotel staff know how many guests are in the hotel or not - in case of fire, for room cleaning etc.. Your belongings can be left in the room. In any case, the staff have master keys that will open all the rooms anyway.