The theme of "Young Goodman Brown" is humanity's weak and corruptible nature. Goodman Brown lives in Salem with his aptly-named wife Faith, whose religious conviction assures Brown that she will be safe while he meets with the Devil. Brown's faith falters when he sees Goody Cloyse, his catechism teacher, speak with the Devil. In the end, Brown's faith hinges entirely on those around him: as soon as he realizes that his friends and family are sinners, he loses all faith in humanity and joins in the Black Mass. He spends the rest of his life suspicious of everyone around him, ashamed of his weakness.
The main message of the story Young Goodman Brown, by Nathaniel Hawthorne, is the fight between good and evil under the scope of detouring from one's faith and succumbing to the evils of life.
Throughout the story, Hawthorne exposes the natural weakness of human nature, and the vulnerability of the human soul to fall into temptation: Nobody, not even the very GOOD-man brown, is excluded from becoming exposed to evil. This is despite of what you deem to be your faith, or in what practices you incur to avoid falling into sin. The story clearly shows that religion, spirituality and a life of righteousness does not preclude complete protection from evil. Evil is everywhere, and anybody could become its victim.
Just like young Goodman Brown left his wife, Faith, and embarked in the dark road through the forest, individuals can deviate and end up in a dark road away from a life of righteousness.
“Young Goodman Brown” by Nathaniel Hawthorne is a story meant to leave its readers with more questions than answers. The story may be an allegory or may simply be the memory of a dream. The "good man" leaves behind "faith" to travel into a dark forest at night to attend some sort of service associated with the Devil. He is ashamed to be seen by fellow villagers, many renowned for their piety, including the woman who taught him his catechism, members of his family, notable preachers, and even his own wife Faith.
These encounters suggest a major theme of the story, that the impulse towards evil is universal, lurking in even the most pious and good people, and that one cannot judge people truly based on one's own perceptions, because one cannot see into actions they do in private or into their hearts.
This question has already been answered on eNotes. Here is a link for you: http://www.enotes.com/young-goodman-brown/q-and-a/what-main-theme-story-young-goodman-brown-what-180957