In allegories, characters are representative of certain traits. For instance, Goody Cloyse, the Catechist, and Deacon Gookin--names of real people who participated in the Salem Witchcraft Trials--go into the forest and participate in the Black Mass. Thus, they represent the sanctimonious hypocrites among the Puritans. Young Goodman Brown's name is, of course, ironic. He certainly perceives himself as good, but his rejection of his wife and others after he has formed his judgment demonstrates his lack of goodness. For he is the quintessential Puritan that Hawthorne abhors: he concludes that all human beings are hopelessly corrupt, totally damned, and must, therefore, be rejected. Brown's wife Faith and her pink ribbons represent the naivete of Brown's own faith in the beginning of the allegory.
Hawthorne's "Young Goodman Brown" is one of the most anthologized and critiqued short stories. It has a great deal of ambiguity, but nonetheless, falls into the category of allegory.
According to enotes in the reference section, allegory is:
Allegory - an extended metaphor in which a person, abstract idea, or event stands for itself and for something else. It usually involves moral or spiritual concepts which are more significant than the actual narrative.
Probably most readers will agree on some aspects: the village—a world of daylight and community—stands (or seems to stand) for good, whereas the forest—a dark, threatening place—stands (or seems to stand) for evil. The old man—“he of the serpent”—is the devil. But, again, even these interpretations have been debated.
The journey into the forest at night (away from the town and away from the daylight) suggests, of course, a journey into the dark regions of the self. The characters and experiences cannot be neatly pigeonholed. For example, it is not certain whether or not Faith yields to “the wicked one”; indeed, it is not certain that Brown actually journeyed into the woods.
Young Goodman Brown does not lose his faith, but rather his faith is purified by his loss of belief that he is of the elect. Before the journey into the woods, he believes that man is depraved but that he himself is of the elect and will be saved. In the forest he sees “a black mass of cloud” hide “the brightening stars,” and his faith is purified, for he comes to see that he is not different from the rest of the congregation.