1 Chronicles 9:27

27 They would spend the night stationed around the house of God, because they had to guard it; and they had charge of the key for opening it each morning.

Read 1 Chronicles 9:27 Using Other Translations

And they lodged round about the house of God, because the charge was upon them, and the opening thereof every morning pertained to them.
And they lodged around the house of God, for on them lay the duty of watching, and they had charge of opening it every morning.
They would spend the night around the house of God, since it was their duty to guard it and to open the gates every morning.