The whole passage up to 3.18 is concerned with a judicial, or at least an interrogative situation (cf. 3.15); either way, the focus here is squarely on the imagery of opposition. Opposition is the link between the Anatolian Christians' readiness to offer an answer to anyone who asks about their curious hope before 3.18, on the one hand, and the reference to Noah and the discussion of Christian social norms after 3.18, on the other.
While the author acknowledges the difference between Christ’s salvific death/resurrection and the suffering of the churches in Asia Minor, he simultaneously points to a vital link between Christ's suffering and the community's. Christ’s suffering paved the way for humanity’s salvation; similarly, the suffering of Christians for their righteous lifestyle in Christ serves to proclaim that offer of salvation to the unbelieving world. Concerning the application of both ἄδικοι [adikoi; "unrighteous ones"] and δίκαιοι [dikaioi; "righteous ones"] to Christians, remember that, “because the notion that Jesus Christ ‘came not to call the just, but sinners,’ was so firmly rooted in the Gospel tradition, it became necessary at times for NT writers to characterize the redeemed as ‘unjust’ or ‘sinners’ before God in order to highlight their new status as ‘just’ or ‘righteous’” (Michaels, 1 Peter, 202—203). In this sense, Peter’s readers are called to suffer in order to lead the world to God before he pours out his judgment on all who are doers of evil, just as Christ suffered in order to lead those who believe to God.
Both Christ's and the community's suffering, then, serve two functions: (i) proclamation, which is achieved when the suffering is for righteousness’ sake and not as a consequence of evil action; and (ii) vindication, which comes after suffering. To miss one point or the other will affect the interpretation of the difficult verse which follows. The suffering of the people of God for the gospel of Jesus Christ serves a similar function as the suffering of Christ; Christ’s suffering functions as a metaphor for the community’s current experiences of suffering. But, more importantly, suffering for righteousness identifies followers of Christ with the One whom they follow.
Notice that Peter never says that Jesus went to the prison; rather, Jesus "went and proclaimed to the spirits in prison"; in the spirit of the NASB, I translate the ἐν φυλακῇ [en phylakē; "in prison"], along with the participle πορευθεὶς [poreutheis; "he went," or "going"], as "he went to the spirits now in prison. They were not necessarily imprisoned when Jesus preached to them. “Although [Noah’s contemporaries] were not then in any physical prison, they have been confined after their death — they are spirits now in prison” (Skilton, "Old Problems," 6).
Peter also describes the spirits to whom Jesus preached as “those who were disobedient when the patience of God was waiting in the days of Noah during the construction of the ark” (3.20). ἀπειθήσασίν [apeithēsasin; "were disobedient"] functions as a temporal circumstantial participle (“when they were disobedient”), rather than an adjectival participle (“those who were disobedient”). “The participle here does not look at all like an attributive or substantive participle, but it looks for all the world like an adverbial participle” (Skilton, "Old Problems," 1–2). Moreover, ὅτε [hote; "when"] suggests a temporal function. Therefore, when we ask, Who are these spirits to whom Jesus made proclamation? the answer is clear: They are those who were disobedient during the construction of the ark. Here Peter draws upon the image of Noah experiencing the same type of opposition which the community is experiencing now. Whether Peter is referring to supernatural spirits who were disobedient (cf. Gen. 6.1–5, 1 Enoch) or human beings who heard the message of God’s judgment and grace (cf. 2 Pet. 2.5) and mocked Noah’s boat-building enterprise is the subject of much debate, and the text itself does not necessarily suggest one over the other.
If we understand τοῖς ἐν φυλακῇ πνεύμασιν [tois en phylakē pneumasin; "to the spirits (now?) in prison") as human agents who were given (and rejected) the chance for repentance upon hearing the proclamation made by Christ [ἐν] πνεὐματι [(in) the S/spirit; cf. 3.18], we need to ask when Peter understood that proclamation to have occurred. Was it while they were spirits in prison, or are they spirits in prison because they did not heed the preaching made to them? We would opt for the latter choice on the basis of the image Peter paints of the spirits’ disobedience “during the construction of the ark”. As Noah built his big boat on the side of an arid mountain, his actions and his preaching (again, cf. 2 Pet. 2.5) proclaimed the coming judgment of God against an evil world.
At some length — 120 years? — it began to rain, and Noah, ridiculed for so long on account of the ark he was building, was the only one prepared to endure God’s judgment. Of course, Noah was prepared for God’s judgment only because God, in his mercy, had provided for him a way of escape. And Noah, in his faithfulness to God, took that way despite the opposition that his faith-in-action drew. In this way, we avoid the incoherent conclusion of Jesus proclaiming the gospel to people who rejected God during their lifetimes. This view is also distinct from the one that sees Peter portraying Jesus as a second Enoch proclaiming his victory — without an option for salvation — to those “sons of God” who were the height of evil and motivated God to deluge his creation.
This explains perfectly the reference to baptism, ὃ καὶ ὑμᾶς . . . νῦν σῴζει [ho kai hymas . . . nyn sōzei], "which now even/also saves you" (3.21). That 1 Peter is a baptismal paranaesis has been widely accepted (cf. 1.22). Here Peter makes the point that baptism, as an example of faith-in-action that incurs opposition from those outside the community, can be understood in precisely the same terms of Noah's ark-building, another example of faith-in-action that brought about opposition. But baptism — just like Noah's ark — does not only bring opposition; it is also the vehicle through which (a) God proclaims his mercy to the world and (b) God vindicates those who suffer for his sake. Noah was saved by the ark; the Anatolian Christians to whom Peter writes will be saved through baptism (again, νῦν σῴζει; nyn sōzei).