It’s a good idea to put any scripture, especially a proof text scripture, in context, by reading at least the chapter before and after the one the proof text is in.
1 Peter 4 starts out with the word SINCE, which is an obvious reference to words that went before that chapter.
Peter had just said this in chapter 3:
1Pe 3:18 For Christ also suffered once for sins, the righteous for the unrighteous, that he might bring us to God, being put to death in the flesh but made alive in the spirit,
1Pe 3:19
in which he went and proclaimed to the spirits in prison,
So the verse in question refers back to the above verses:
1Pe 4:6 For for this cause was the gospel preached also to them that are dead, that they might be judged according to men in the flesh, but live according to God in the spirit.
These scriptures refer to the fact that the righteous dead in the OT could not ascend to heaven until Messiah came and atoned for their sins, so they were held in a place in hades called Abraham’s bosom, (referred to in the account of the rich man in torments, who looked across the great chasm separating the damned from the chamber Abraham and Lazarus were in):
Luk 16:22 And it came to pass, that the beggar died, and was carried by the angels into Abraham's bosom: the rich man also died, and was buried;
Luk 16:23 And in hell he lift up his eyes, being in torments, and seeth Abraham afar off, and Lazarus in his bosom.
Luk 16:24 And he cried and said, Father Abraham, have mercy on me, and send Lazarus, that he may dip the tip of his finger in water, and cool my tongue; for I am tormented in this flame.
Luk 16:25 But Abraham said, Son, remember that thou in thy lifetime receivedst thy good things, and likewise Lazarus evil things: but now he is comforted, and thou art tormented.
Luk 16:26 And beside all this, between us and you there is a great gulf fixed: so that they which would pass from hence to you cannot; neither can they pass to us, that would come from thence.
When Jesus died, scripture says He descended into the lowest part of the earth and preached to those spirits in captivity - the OT righteous dead held captive in the heart of the earth- and when He rose he “led captivity captive” meaning He emptied out Abraham’s bosom, aka paradise (which is now in heaven) and now souls of the righteous dead go straight to heaven:
Eph 4:8 Wherefore he saith,
When he ascended up on high, he led captivity captive, and gave gifts unto men.
Eph 4:9 (Now that he ascended, what is it but that
he also descended first into the lower parts of the earth?
This is why many saints arose after Jesus’ resurrection and went into the city:
Mat 27:52 And the graves were opened; and many bodies of the saints which slept arose,
Mat 27:53 And came out of the graves after his resurrection, and went into the holy city, and appeared unto many.
Those spirits in prison were the OT righteous dead kept in the heart of the earth, who were the dead that Jesus preached to, in the OP verse.
Shalom Aleichem