The dedication of the wall of Jerusalem required strict spiritual and physical preparation. This process unfolded in careful stages, moving outward from the individual to the entire city. It began with the spiritual leadership. The Priests and Levites first purified themselves through immersion, washing away their own impurities [מצודת דוד]. Only after achieving personal purity could they step forward to purify others [רש״י, רלב״ג].
Once the leaders were ready, the focus shifted to the general public. The Priests and Levites actively encouraged and urged the people to undergo their own process of purification [מצודת דוד].
The final stage of preparation was dedicated to the physical environment. The gates and the wall underwent a thorough purification process designed to clean and remove any trace of defilement from the structures. This final step ensured that absolutely no impurity remained within the city as it was readied for the dedication.