I think the principal reason for the massive change in Goodman Brown's personality is the way in which the people he has thought he could have massive trust in have been shown to be in league with the devil and massive hypocrites in terms of their Christianity. One by one, as he ventures towards his destination in the dark woods, it is clear that each of the saints of his community are shown to be in league with the devil as well. Note the way, for example, that overhearing the conversation between the deacon and the minister talking about devilry impacts Goodman Brown during the story:
The hoofs clattered again; and the voices, talking so strangely in teh empty air, passed on through the forest, where no church had ever been gathered or solitary Christian prayed. Whitehr, then, could these holy men be journeying so deep into the heathen wilderness? Young Goodman Brown caught hold of a tree for support, being ready to sink down on the ground, faint and overburdened with the heavy sickness of his heart. He looked up to the sky, doubting whether there really was a heaven above him.
Goodman Brown experiences such a change in his character because his thoughs of saintliness and holiness in others are shown, one by one, to be false. As he is confronted with the universal nature of sinful man, he becomes cold and cynical, as everything he has ever believed in about the essential goodness of humanity has been contradicted.