They would spend the night stationed around the house of God, because they were responsible for guarding it and opening it every morning.
Jewish Publication Society of America Version (JPS1917) - 1 Chronicles 9:27 >And they lodged round about the house of God, because the charge thereof was upon them, and to them pertained the opening thereof morning by morning.