Then when he says, If then you have such cases, he applies the remedy for their fault: first he mentions the remedy; secondly, he explains (v. 5).
First, therefore, he says: Therefore, since the saints will judge this world, if you should have secular trials among you, which, nevertheless you should not have, those least esteemed in the Church should be appointed to judge, rather than be judged by unbelievers. "Let a good man strike or rebuke me in kindness, but let the oil of the wicked never anoint my head" (Ps 141:5); and in Ec (9:4) it says: "A living dog is better than a dead lion."
Or ...in another way: For he had said that the saints are worthy to judge worldly matters; consequently, he wants to show by whom worldly judgments should be passed, namely, by the least esteemed in the Church. By "least esteemed" he means those who are wise in worldly matter as opposed to those wise in divine matters and are not occupied with temporal things, in order to devote themselves strictly to spiritual things. And this is what is added to: I say this to your shame. Hence the apostles said in Ac (6:2) "It is not right that we should give up preaching the word of God to serve tables." After that he returns to what he had censured earlier, namely, that the Corinthians took their lawsuits to unbelieving judges, saying: Can it be that there is no man among you wise, namely in temporal affairs, which he called contemptible earlier. Hence the other things are not changed from the first explanation, which seems to be more literal.
Source: Commentary on 1 Corinthians