In the Introductory to The Scarlet Letter, Hawthorne writes about his progenitor from Salem, Massachusetts:
He was a soldier, legislator, judge; he was a ruler in the Church; he had all the Puritanic traits, both good and evil. He was likewise a bitter persecutor; as witness the Quakers, who have remembered him in their histories, and relate an incident of his hard severity towards a woman of their sect, which will last longer, it is to be feared, than any record of his better deeds, although these were many. His son, too, inherited the persecuting spirit, and made himself so conspicuous in the martyrdom of the witches, that their blood may fairly be said to have left a stain upon him....
Planted deep, in the town's earliest infancy and chilhood,...the race has ever since subsisted here; always, too, in respectability; never, so far as I have known, disgraced by a single unworthy member....
This is milieu into which Hester Prynne finds herself judged and marked. With its prison as a reminder of its fiercely strict laws, as well as the scaffold, few of the community have dared to defy Puritan law. So, when Hester does, the punishment is terrible in order to make an example of her since sinners are perceived as the foulest of souls and must be severely punished. Added to this, in this location there live the Governor and other dignitaries who wish to avert any other scandal by punishing Hester Prynee severely.
The Massachusetts Bay Colony wanted to be a model community. So, toward the realization of this ideal, the Puritans required a strict moral regulation that demanded that anyone in violation be punished because whoever sinned threatened both the religious and the civil perfection for which the Puritans strove.
Hester Prynne is treated extremely harshly by her peers in The Scarlet Letter. At the time of the novel's setting, Boston was a Puritan village and was only about twenty years old. Members of Boston's society had settle there after being persecuted in Europe. Puritans believed that wrongdoings were evidence of a lack of salvation, so they punished sins harshly. They believed in religious purity, and would not have tolerated anything else.
Had the story been set elsewhere, Prynne's sins might have been dealt with in a less severe manner. Some religious sects would have been willing to deal with Prynne's adultery with more kindness, especially considering her husband's absence. However, the Puritan way of thinking did not include the possiblity of areas of gray; matters of crime and punishment would have been only black and white.