"For if God did not spare angels when they sinned, but sent them to hell, putting them into gloomy dungeons to be held for judgment;" NIV translation
Peter gives us the first of three examples of how God has judged sin in the past. We remember that the number three is associated with God's will being displayed and through these examples we see that God's will is for sin to be judged. If we are in Christ, then our sins were judged on the cross but, without Christ, the sinner is held accountable for his sins. He gives us these examples to reassure us that God is in control and watches over us as His children. When the angels sinned against God, He cast them out of heaven and they are being held for judgment. The hell that Peter is talking about here is not the hell that we think of. This is not the hell which is the final punishment for sin but this is like a holding cell in a prison. This first example tells us that God does not show favoritism in dealing with sin as all sin (even the sin of angels) must be judged.
"if he did not spare the ancient world when he brought the flood on its ungodly people, but protected Noah, a preacher of righteousness, and seven others;" NIV translation
The second example of God's judgment comes from Genesis 6 and the great flood.
We see from this example that the wickedness of the people had gotten so great that God punished them but saved the righteous (Noah and his family). This example reminds us that God judges sin on a personal basis and each will pay for their own sins.
"if he condemned the cities of Sodom and Gomorrah by burning them to ashes, and made them an example of what is going to happen to the ungodly; and if he rescued Lot, a righteous man, who was distressed by the filthy lives of lawless men (for that righteous man, living among them day after day, was tormented in his righteous soul by the lawless deeds he saw and heard) -" NIV translation
The third example comes from Genesis chapter nineteen and is an example of where God judges sin as a group. These cities were living for the flesh and everything was permitted by men. They were sorta the Las Vegas (sin city) of the day and God burned the cities to the ground to where they are not even recognizable as cities to this day. But, God rescued Lot from among them and we see here that Lot was distressed as he lived among the filth day after day. We need to ask ourselves the question are we distressed by the lawless things we see around us today or are we comfortable with it? I hear of many "Christians" who go to Vegas for a vacation and wonder how can we go and wallow in sin as children of light and be ok with it? The city slogan is "What happens in Vegas stays in Vegas" but it is a lie straight from the devil's mouth.