TT #259 · Parashas Shoftim · Sixth Aliyah · Passuk 19:19
Then you shall do to him as he had plotted to do to his brother, and you shall purge the evil from your midst.
Torah Temimah points to Sifrei Devarim 190.
TT lemma: וּבִעַרְתָּ הָרָע מִקִּרְבֶּךָ.
English: ‘And you shall purge the evil from your midst’ – to teach that they bring him to the court.
Derash on judicial procedure (Sifrei) — the purging is done through the formal court process.
The evil of the false witnesses is purged by a formal judicial process, not by private action.