The Temple required a dedicated system of protection to maintain its sanctity and order. Following the musicians, a specific group of Levites was assigned to serve as guards and gatekeepers at the Temple entrances [ביאור שטיינזלץ]. The double emphasis on both guarding and keeping the gates serves to highlight and clarify the exact nature of their duties [מצודת דוד]. These men stood at fixed posts, permanently assigned to protect the doors of the Temple at these specific locations [רש״י, מצודת דוד].
The exact location or nature of this guard duty is understood in a few distinct ways. The primary approach among commentators is that their watch focused on the physical structure of the gates themselves, specifically the thresholds and lintels of the entrances [אבן עזרא, רש״י, רס״ג, ביאור שטיינזלץ]. Alternatively, some suggest they were stationed at a specific, well-known location within the Temple complex called the House of Gatherings [מצודת דוד]. A third perspective offers a different understanding of their role entirely, linking their title to the concept of assembling. According to this view, these individuals were not ordinary guards. Rather, they served as commanders and leaders over the rest of the Levites, who would gather at the gates under their direction to fulfill their protective duties [רלב״ג].