The greatest irony in Hawthorne's story "Young Goodman Brown" is that Young Goodman Brown, named after a grandfather who was "an old friend" of the devil who walks the younger man to the black mass, is not good at all. Shocked at the hypocrisy of everyone else--Deacon Gookin and Goody Cloyse--Goodman Brown is far darker in his soul than any of the others, whose names he finds ironic without realizing that his own is the most ironic. For, it was "a dream of evil omen for Young Goodman Brown."
A stern, a sad, a darkly meditative, a distrustful, if not a desperate man did he become from the night of that fearful dream.
After his night in the forest, the irony is that Goodman Brown, the sanctimonious, self-righteous Puritan who loses his faith more than any other, perceives evil in all with which he comes into contact--Faith, the minister, the congregation, his children and grandchildren.
Well, this story operates on a number of different levels, and some critics argue that it can function allegorically, especially considering the names of the characters. What is interesting in Goodman Brown's thinking about his first and last revel with the Devil is that Goodman Brown continually thinks of his good wife Faith and imagines her shock if she knew where he was and also dreams of what it would be like to be with her. Consider this quote:
And what calm sleep would be his that very night, which was to have been spent so wickedly, but so purely and sweetly now, in the arms of Faith!
To me, the biggest piece of irony in the story is that, one by one, all of the "spiritual giants" of Goodman Brown's church are shown to be in relationship with the devil, even up to and including Faith herself. Clearly Hawthorne is showing the massive hypocrisy in the midst of the Puritan elect, whilst also indicating the innate sinfulness that exists within all humanity. It is this fact that destroys Goodman Brown's hope and faith in the elect and the redeeming power of good, and he comes back from his experience a changed man:
A stern, a sad, a darkly meditative, a distrustful, if not a desperate man did he become from teh night of that fearful dream.
Goodman Brown is not able to accept the innate sinfulness that is in all of us and this denial casts a shadow on the rest of his life.
Therefore irony is used to highlight the hypocrisy of the Puritan community and also establish one of the key themes of this short story - the innate sinfulness of humanity.
Hawthorne also uses irony to highlight how a righteous act can condemn a man to a life of misery and suspicion. One can assume that Goodman Brown's refusal to accept the Devil's invitation to knowledge is a righteous act. He resists the temptation, which Adam and Eve originally fell for (knowledge), by throwing his head up and crying "look up to heaven, and resist the wicked one." He responds to the Devil's temptation opposite to the Biblical storyline, however he suffers the same consequences. This contradiction begs the question,"Why?" Hawthorne has used irony here to show the limitations of one's rigid doctrine and Goodman Brown's refusal to accept the knowledge about both the light and dark in human nature leads to his life of gloom. Goodman Brown's perceived righteousness is actually is downfall.