Hawthorne has some issues with Puritanism, to put it mildly. The self-rightceousness, the meanness, and the penchant for fanaticism are all anathema to Hawthorne on a deep level. "Young Goodman Brown" takes this theme, Hawthorne's distrust of the Puritan church, and plays with it. It's a very, very scary story. I found this much scarier than the readings we were assigned on Poe because of the uncertainty. Is the entire thing a dream? Is Goodman Brown the lone Christian in all of Salem? The illusion forces one to confront their own prejudices about Puritans. If you think Puritans are self-rightceous fascists, then you would probably sympathize with Goodman Brown. If you stand on the other side, then Goodman Brown is simply a crazy old dude with too active an imagination. But, what makes this story all the more intense is that Hawthorne can play with his reader regardless of their sympathies or faith.
Goodman Brown plays the role of the dupe/cuckold, regardless of your sympathies or thoughts about Puritanicalism. Hawthorne makes it such that if you are a hardcore Puritan, then it becomes very hard to dismiss the thought that Goodman simply suffered from a bad dream. Salem was an area known for its legacy of witchcraft and it is well known in Puritanical thought that the devil actively corrupts the soul. On the other hand, if you are not Puritan or devout, you can mock Goodman's delusions as the result of a person forced to consume terriffying religous poppycock and believing in it so absolutely that it causes one to fall into insanity. Either way, the reader loses, and Hawthorne wins.