By "judgment" the apostle here means not condemnation, but examination, investigation. He strikes fear into them in order to turn them away from a dissolute life. This is why he also adds: if your life is examined first, then what end will there be for the disobedient? Judgment begins first with the house of God. For, in the words of Basil the Great, we naturally grow indignant with our own household members when they offend us. And God's own are none other than the faithful who fill His house, that is, the Church. Therefore the Savior also said: "He shall first say to those on His right hand"... (Matt. 25:34). By judgment or examination he here means the afflictions inflicted on the faithful by the ungodly, the coming of which the Lord foretold, saying: "they will deliver you up to councils," and so on (Matt. 10:17). Then, as if to comfort them, he says: if He does not spare you, who are so close to Him, then imagine what end there will be for the ungodly! And he confirms this with a passage from Scripture: "if the righteous one is scarcely saved, where will the ungodly and the sinner appear?" (cf. Prov. 11:31). The meaning of the discourse is this: if the righteous one obtains salvation with difficulty and exertion — "for the Kingdom of Heaven is taken by force" (Matt. 11:12) — and if anyone obtains it, it is through "many tribulations" (Acts 14:22), then what portion will those who spend their life in luxury and pleasures receive — it must be understood, the ungodly — in the age to come? Therefore we too, who suffer according to the will of God, must not lose heart, but must commit our souls to Him as to a faithful Creator, while doing good.
Source: Commentary on 1 Peter