In addition to the answer above, remember that Poe focused his fiction (and poetry) on the idea of a "unique and single effect." He believed that all elements in a piece should build tension (both in the story and in his audience) that was to be released at the climax, creating an emotional reacton in his reader. When the Red Death comes "like a thief in the night," a sense of dread should be palpable -- no one can evade death, and Poe wants his readers to make his readers feel the futility as deeply as his characters do.
The climax is the most intense moment of the story, and it lets us know how the main conflict of the story will be resolved. The suspense of the story builds to this moment of climax. In this story, the climax occurs when the Red Death is able to come in "like a thief in the night". This climax resolves the problem of death. No one can escape death, not even Prince Prospero and his wealthy friends. Poe sets the stage for this mysterious story beautifully, and we realize his message about death at the end.