Achieving true spiritual purity required the Israelites to undergo a challenging two-step process. First, they had to physically distance themselves from foreign influences, and only then could they stand and confess the sins of both their past and present. This gathering served as a crucial moment for the people to deal directly with the deep-rooted problem of intermarriage that had slowly spread among them over time [שטיינזלץ].
The primary approach among commentators is that this separation specifically involved leaving foreign wives who worshipped idols. This physical break was absolute, as it also required the Israelites to distance themselves from the children born to these women [מצודת דוד].
From a historical perspective, the battle against intermarriage was an ongoing struggle. It is possible that the people had already separated from their foreign wives when Ezra first arrived, but later failed and committed the same sin again, forcing them to repeat the process of separation. Alternatively, this gathering may have actually taken place much earlier, during the time of Zerubbabel. According to this view, the practice of intermarriage continued to grow and spread unchecked until Ezra finally arrived to correct the issue permanently [מלבי״ם].