Hawthorne clearly wanted to distance himself from his hanging-judge ancestor, John Hathorne, and he began that process by dropping the "w" from his last name. Denying one's name often signals a denial of family, and in Hawthorne's case, it is reasonable to believe that he wanted to atone for his great-grandfather's actions by depicting the negative effects of Puritanism on men and society. Several of Hawthorne's short stories, including "Young Goodman Brown" and "The Minister's Black Veil," explore the disastrous sense of guilt on man's view of the world.
Among the many things that Puritans feared, dreams were close to the top of their list simply because dreams could not be controlled and, more important, left the dreamer susceptible to the Devil's intervention. If we can agree that Goodman Brown's journey through the forest is part of a dream vision, then we can see that Brown's desire to explore his dark side has been working at a subconscious level at becomes realized through the dream: he meets the Devil, who vaguely resembles Brown's family and knew Brown's father and grand-father; he sees that his trusted religious teacher, Goody Cloyse, is an intimate acquaintance of the Devil; Brown sees the most trusted men of the village walking to the Devil's ceremony. During a very surrealistic scene, Brown hears his wife's (Faith's) voice in the clouds above him and watches her pink ribbon float down. At this point, Brown clearly understands that everything he thought about people is completely wrong.
The culmination of the dream vision occurs at the ceremony in the middle of the forest, which is, of course, a product of Goodman Brown's mind and reflects the Puritan's concept of a Witches' Sabbath. He sees Faith participating and tries mightily to save her--"look up to heaven, and resist the wicked one"--but as we see in the next few lines, Brown awakens "amid calm night and solitude, listening to the roar of the wind. . . ." At this point, unless we subscribe to the Puritan's belief that the Devil is a physical presence in our world, we must conclude that Brown's experience takes place in his imagination.
When Goodman Brown returns to the village (perhaps he never left), his life is changed:
A stern, a sad, a darkly meditative, a distrustful, if not a desperate man did he become from the night of that fearful dream . . . they carved no hopeful verse upon his tombstone, for his dying hour was gloom.
Hawthorne's ultimate comment on the destructive nature of Puritanism, particularly the sense of all-pervading guilt, is that this belief system blights, rather than enlightens, the life of man. And, in a sense, this story (and others) can be seen as an attempt by Hawthorne to atone for the sins not only of his ancestors but also for the sins of a belief system.