To answer this question it is important to be aware of how this story functions as an allegory. An allegory is a particular type of tale where characters, events and objects act both literally but also suggest or point towards some other quality or characteristic. This is most obvious in the use of names in this story, with Faith, Goodman Brown's young wife, being a clear use of allegorical naming. Note how she is introducted as being "aptly named" in the first paragraph, and how she is refered to by Goodman Brown after he bids her farewell:
Well, she's a blessed angel on earth; and after this one night I'll cling to her skirts and follow her to heaven.
Faith's character is clearly meant to suggest some kind of Christian goodness or innocence that allows those who cleave to her to gain access to heaven. Once we understand the allegorical nature of this story we can see how everything else can be considered to be an internal journey of one man's soul into the world of evil. The forest itself, and the fellow traveller that Goodman Brown comes across, clearly represent evil, and we see this story allegorically as representing the evil that tempts us all.