The expressions "black as pitch" and "pitch black" refer to the color of coal tar pitch. It is a very black, sticky substance that is used as road tar or to waterproof roofs. If a room is "pitch black," then it is extremely dark.
Pitch is the color of tar, which is a deep dark black. The full lines in which this simile occurs read: His room was as black as pitch with the thick darkness (for the shutters were close fastened through fear of robbers), and so I knew that he could not see the opening of the door, and I kept pushing it on steadily, steadily.
"Pitch," alludes to the lack of light in the room in a literal sense. In the gothic sense, pitch is also often used in reference to midnight, to things satanic, and to evil in general. By employing the similie in this way, Poe brings a sense of both physical and emotional doom to the story.
This is an idiomatic expression used to create the imagery of something being so dark that one cannot see through it. Pitch in this simile is referring to any tar like substance which is sticky and opaque. Poe uses it, first because it was a common idiom of the times which people understood and second because it really gave the reader the image of just how dark the room was. Similes like this one help to create the mood or feeling that the story has.