King Josiah initiated a massive campaign to purify the land from forbidden worship and centralize all religious service. As part of this sweeping reform, he took decisive action against the local altars scattered throughout the kingdom and the priests who operated them. His first step was gathering all the priests from the cities of Judah. The primary approach among commentators is that these were actual descendants of Aaron who had strayed and become priests of foreign idols. Josiah brought them to Jerusalem with the hope of guiding them toward repentance [מצודת דוד, רד״ק, אברבנאל, רלב״ג]. Other perspectives suggest that these priests were not worshiping idols but were instead offering sacrifices to God on local altars, a practice that was strictly forbidden [ביאור שטיינזלץ]. Another view proposes a more practical motive, suggesting Josiah brought them in so they could identify the exact locations of the forbidden altars and personally defile them [מלבי״ם].
The king then turned his attention to the altars themselves, which were spread across the entire kingdom from Geba to Beersheba [ביאור שטיינזלץ]. To neutralize these sites, he defiled the places where the priests had burned incense. This defilement was carried out by throwing animal carcasses and other impure objects onto the altars. The underlying goal was to expose the complete worthlessness of the foreign idols, making the practice of idolatry thoroughly disgusting and removing it from the hearts of the people [רד״ק, אברבנאל, צאינה וראינה]. Interestingly, Josiah chose only to defile these particular altars rather than tear them down completely, as most of them had originally been dedicated to the worship of God [מלבי״ם].
However, his treatment of the altars positioned at the city gates was much harsher. Instead of merely defiling them, he completely shattered them. One specific altar located at the entrance of the gate of Joshua, the city governor, receives special attention. Most commentators explain that this site is highlighted because it was the largest and most prominent of all the gate altars [מצודת דוד, רד״ק, אברבנאל]. This massive structure stood directly to the left of anyone entering the city [מצודת דוד, רד״ק, ביאור שטיינזלץ]. Offering a more conceptual interpretation, one view suggests that the specific mention of the name Joshua carries a historical critique, hinting that Joshua the son of Nun should have completely eradicated such idolatry from the land during his own era [אהבת יהונתן].