Then when he says, But if all prophesy, he shows that good follows from the gift of prophecy. In regard to this he does three things: first, he shows what follows through the good of prophecy, as to unbelievers; secondly, he shows how this follows (v. 25); thirdly, he infers which effect arises from this (v. 25b).
He says, therefore: It is clear that unbelievers are not convinced by the gift of tongues; but if all who assemble prophecy, i.e., all speak to the intellect revelations made to them (I say "all" not at once, but one after the other prophesy in this way), then if an outsider enters ...the church, i.e., knowing only his mother tongue, what follows is good, because he is convicted by all of his error, which is pointed out to him: "After I was instructed, I was ashamed" (Jer 31:19). He is called to account by all who are prophesying. As if to say: he is shown to be condemnable for his evil morals and his vices: "The spiritual man judges all things" (1 Cor 2:15). For prophecy avails for these two things, namely, strengthening the faith and teaching morals.
Source: Commentary on 1 Corinthians