Goodman Brown's journey into the dark night forest to confront evil is an allegory for confronting the evil within his own soul. He has stuffed his own evil down and denied it, believing himself to be a good, pious person, but his faith is largely a facade, even if he doesn't realize it. He is concerned with surface appearances and how he appears to other people more than with his internal faith life. He has little tolerance for the idea that people, including himself and his neighbors, are inevitably a mix of good and evil. He has to "other" the evil in his own soul, projecting it on to outside figures. That is why the "strange man," or devil, looks like him. It is a representative of his own evil, but he displaces it to outside of himself. The narrator states explicitly that in the woods, Goodman Brown's evil or devilish side is released:
In truth, all through the haunted forest there could be nothing more frightful than the figure of Goodman Brown. ... The fiend in his own shape is less hideous than when he rages in the breast of man.
In literature, it is not uncommon for the devil to appear in a form that is familiar to the person he is deceiving. Therefore, Hawthorne having the strange man in the woods look like Brown gives credibility to Brown continuing on this journey even when he has doubts. In addition, resembling Brown himself foreshadows Brown's realization that all mankind at some point in life has dealings with the devil, including Brown's own family. Thus, the devil in Brown's likeness connects Brown and all kin to the evil in the world.