What is Hawthorne's main purpose in Young Goodman Brown? What is he trying to do?
Hawthorne criticized the ideas and philosophies of Puritanism. In one hand, the elders and followers claim to be men and women of "goodness", or God. Yet, they also teach in the other hand how men are inherently evil, without destination unless that decided by God, and with little to no ability to make any decisions, as we are always being guided by our own malignant nature.
Young Goodman Brown did the same thing, he basically exposed himself as a regular man with the same penchant to sin and make mistakes like everyone else, but the irony is that Hawthorne makes reference to the epiteth "Good man" as a way to contrast the irony in the main idea: Someone can APPEAR to be a "good man", but deep inside we all have the same pronness to commit sin and break our own rules.
To me, Hawthorne is trying to tell us something that he thinks is important about human nature and about how we deal with it.
In the story, he is trying to show that human nature has an evil side to it. I think this is what is happening with Brown -- it is why he has to go with the Devil at least once.
But once you realize that humans have an evil side, how do you react? Brown reacts by becoming completely alienated from people. He loses all trust and faith in humanity.
I believe Hawthorne is saying that we need to realize people are partly evil, but we can't let that ruin our lives or our view of humanity.