(The following is taken from DAVID GUZIK COMMENTARY ON THE BIBLE, Studylight.org)
(1 Peter 4:3-6) In the last days, Christians should live with an attitude of wisdom.
For we have spent enough of our past lifetime in doing the will of the Gentiles; when we walked in lewdness, lusts, drunkenness, revelries, drinking parties, and abominable idolatries. In regard to these, they think it strange that you do not run with them in the same flood of dissipation, speaking evil of you. They will give an account to Him who is ready to judge the living and the dead. For this reason the gospel was preached also to those who are dead, that they might be judged according to men in the flesh, but live according to God in the spirit.
Lewdness means to live without any sense of moral restraint, especially in regard to sexual immorality and violence. When we look at this list (lewdness, lusts, drunkenness, revelries, drinking parties, and abominable idolatries), we see just how little fallen man has progressed in the last 2,000 years.
The magnitude of their foolishness will be displayed on they day when they will give an account to Him who is ready to judge. Even if one seems to live the “good life” living by the world’s rules, their life will be a waste in the measure of eternity.
For this reason the gospel was preached also to those who are dead: Peter also says that because of this eternal judgment the gospel was preached to the dead. The righteous dead know, and live in constant awareness of, the reality of eternity - and are rewarded by this understanding as they live according to God in the spirit.
Peter has already told us that Jesus preached to the spirits in prison, preaching a message of judgment (1 Peter 3:19). Apparently during this same time, Jesus also preached a message of salvation to the faithful dead in Abraham’s Bosom (Luke 16:22) who anticipated the work of the Messiah for them.
This preaching to those who are dead was not the offer of a second chance, but the completion of the salvation of those who had been faithful to God under their first chance.
In doing this, Jesus fulfilled the promised that He would lead captivity captive (Psalms 66:18; Ephesians 4:8) and would proclaim liberty to the captives and the opening of the prison to those who are bound (Isaiah 61:1 and Luke 4:18).