"Young Goodman Brown" is most likely set in the mid-seventeenth century, certainly before the Salem witch hysteria that culminated in the hanging of nineteen people, mostly women, in 1693. The early-to-mid eighteenth century seems to be the period in which "The Minister's Black Veil" is set. One of the most important themes Hawthorne pursues in both stories is the concept of hidden or secret sin, and his main characters, Young Goodman Brown and Reverend Hooper, become obsessed by a belief in hidden sin--to the extent that they are willing to sacrifice their own happiness, as well as the happiness of a wife and fiancee.
When Goodman Brown returns from his night in the forest where he has had a vision of evil within all the people he once thought were godly and virtuous, he encounters his wife, Faith participating with those with hidden sin:
. . . he spied the head of Faith . . . gazing anxiously forth . . . [who] almost kissed her husband before the whole village. But Goodman Brown looked sternly and sadly into her face, and passed on without a greeting.
From that time on, Brown lived an isolated life, turning away from his society and his wife, all because he assumed that everyone--including Faith--had within them the same "evil" thoughts that he felt. In other words, he believed that all men and women were guilty of "flirting" with the Devil. Because of his experience in the forest, which actually occurred only as a dream or vision, he ruined the rest of his life, as well as Faith's.
Reverend Hooper, like Young Goodman Brown, came to the belief that all men were hiding their sins from each other and that no true communication coud exist unless everyone "came clean" and opened their hearts and exposed their sins. Hooper demonstrated this conviction by wearing the black veil, a symbol that no one in his congregation, including his fiancee, Elizabeth, could understand. When Hooper refused Elizabeth's request to remove the veil even temporarily, Hooper refused, and Elizabeth left him "pausing at the door, to give one long shuddering gaze, that seemed almost to penetrate the mystery of the black veil."
Reverend Hooper's belief in man's hidden sins is in a direct line of descent from Young Goodman Brown's conviction that all men (and women) are evil, but Reverend Hooper, unlike Brown, was attempting--obviously in an ineffective way--to teach his congregation that they needed to expose their inner sins in order to cleanse themselves. But both men, no matter their motives, ruined the lives of others--in modern terms, Faith and Elizabeth became "collateral damage."