Amid intense security threats and the massive effort to fortify Jerusalem, a new directive merged physical labor with constant military readiness. During the period before the city wall was finished [מצודת דוד], an urgent call went out to the workers who had traveled from nearby Judean towns to assist [מצודת דוד]. Every builder, accompanied by another young man [רש״י], was ordered to spend the night inside Jerusalem rather than returning home [ביאור שטיינזלץ]. This requirement ensured that a standby force was always available to defend the city against a sudden enemy ambush [מצודת דוד].
A strict, around-the-clock schedule was established to balance these dual needs. The primary approach among commentators is that the nighttime hours were entirely devoted to guarding the city from attackers, while the daylight hours were reserved for the actual construction work [רלב״ג, מלבי״ם, ביאור שטיינזלץ, מצודת דוד]. Because this routine was so demanding and left no breaks between the day's labor and the night's watch, it is understood that the builders essentially did not sleep at all [רש״י].