From Poe's "Philosophy of Composition":
The idea of making the lover suppose, in the first instance, that the flapping of the wings of the bird against the shutter, is a "tapping" at the door, originated in a wish to increase, by prolonging, the reader's curiosity, and in a desire to admit the incidental effect arising from the lover's throwing open the door, finding all dark, and thence adopting the half-fancy that it was the spirit of his mistress that knocked.
Read the Full Text.