It seems to me that this passage is best understood in its wider context: Peter is exhorting his readers to proclaim the righteousness of God in face of persecution.
He tells them to follow the example of Christ, who also suffered. Christ, in spirit, preached righteousness through Noah to his generation. Because they disobeyed, they perished in the flood and are now "in prison" awaiting their final judgment.
Similarly, despite the present persecution, Peter's hearers should nonetheless follow Noah's example, proclaiming Christ's righteousness to their own generation.
He tells them to follow the example of Christ, who also suffered. Christ, in spirit, preached righteousness through Noah to his generation. Because they disobeyed, they perished in the flood and are now "in prison" awaiting their final judgment.
Similarly, despite the present persecution, Peter's hearers should nonetheless follow Noah's example, proclaiming Christ's righteousness to their own generation.