"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."
Peter did not imply that the gospel was then being preached to the souls of the dead, as some teach. He said the gospel "was preached" to those who "are [now] dead." The preaching was done while they were still alive, and they will be judged on the basis of how they lived "according to men in the flesh," or while they were still alive.
Peter is undoubtedly talking about the Christian dead, because he refers to their living again "according to God [as God lives] in the spirit." In other words, they will receive immortality in the resurrection and will have a life that measures with the life of God.