So shall it be at the consummation of the world. Here he explains the parable. And it should be noted that he explains only as to the wicked. But then the question arises, why he explains about the wicked rather than the good. It must be said that he had made mention of the net, by which, when fish are caught, the bad are cast out and live; but the good are killed and eaten. Therefore someone could say that so it would be on this side; therefore in order to exclude that, he explains, saying the angels shall go forth, not that they depart from their inmost contemplation, because wherever they a...re, they contemplate God; but because they go forth to an external ministry. Daniel 9:22 says of a certain angel: I am come forth to teach you. And shall separate the wicked from among the just. Now the wicked are among the good, the weeds in the midst of the wheat, the lily among the thorns, but they will be separated from the company of the good; and from this comes wicked excommunication; this, however, is a sign of that, but it is different, because the Church is often deceived, but then there will be no deception. This is what the Apostle says, 1 Cor 16:22: if any man love not our Lord Jesus Christ, let him be anathema. Hence it is said: let the wicked be removed, that he may not see the glory of God.
Source: Commentary on Matthew