The implication is that (some of) the builders commonly spent the night in villages around Jerusalem (Nehemiah 3:1–32; some had homes not overly far from Jerusalem, perhaps requiring an hour’s walk). By having them now stay in the city, Nehemiah ensured that less time was lost on travelling to and from their lodging, and hence more time could be devoted to the rebuilding project. That is what Nehemiah hints at with the closing words of the verse, and may labor by day.
Further, by staying in the city these workers were a ready army for defending the city in case of a night attack, as Nehemiah also writes: that they may be a guard for us by night.
The unspoken element of this new requirement was that deserting the project now became more difficult, a real possibility given the pressure described in Nehemiah 4:12 and the constant fear of attack.
22 I also said to the people at that time, “Let every man and his servant pass the night within Jerusalem, that they may be a guard for us by night and may labor by day.”