Otherwise; He has drawn out thus far the consequences of his injunctions of almsgiving; He now takes up those respecting prayer. And this doctrine is in a sort a continuation of that of the prayer; as though it should run, Forgive us our debts, and then should follow, Judge not, that ye be not judged.
But some explain this place after a sense, as though the Lord did not herein forbid Christians to reprove others out of good will, but only intended that Christians should not despise Christians by making a show of their own righteousness, hating others often on suspicion alone, condemning them,... and pursuing private grudges under the show of piety.
But that not even thus should Christians correct Christians is shown by that expression, Judge not. But if they do not thus correct, shall they therefore obtain forgiveness of their sins, because it is said, and ye shall not be judged? For who obtains forgiveness of a former sin, by not adding another thereto? This we have said, desiring to show that this is not here spoken concerning not judging our neighbour who shall sin against God, but who may sin against ourselves. For whoso does not judge his neighbour who has sinned against him, him shall not God judge for his sin, but will forgive him his debt even as he forgave.
Source: Catena Aurea by Aquinas