Show and explain the reaction of people around the prison in chapter one? And why does the novel begin with prison gates?
Part of the key to your question comes at the beginning of the chapter:
The founders of a new colony, whatever Utopia of human virtue and happiness they might originally project, have invariably recognised it among their earliest practical necessities to allot a portion of the virgin soil as a cemetery, and another portion as the site of a prison.
No matter what hopes the founders of our country had, even the most optimistic about its possibilities, the had to realize that two of the not so optimistic realities of human life, crime and death, had to be acknowledged and provided for. Its description fits its purpose, and specific mention is made to the "iron" work, reminiscient of the reference made later to Dimmesdale's need for an "iron framework" (faith) which, while it confines him, is necessary for his support.
Hawthorne notes that in their society "religion and law were almost identical." The Puritan code of ethics was very strick, for practical as well as religious reasons, and Hawthorne talks about this when he speaks of the women who came to watch Hester's punishment.
Morally, as well as materially, there was a coarser fibre in those wives and maidens of old English birth and breeding than in their fair descendants, separated from them by a series of six or seven generations; for, throughout that chain of ancestry, every successive mother had transmitted to her child a fainter bloom, a more delicate and briefer beauty, and a slighter physical frame, if not character of less force and solidity than her own.
Things that we now take for granted because we have "less force and solidity," the took much more seriously. Their reaction is based on the strictness of their personal beliefs, but it's also interesting to note that Hawthorne's description of them seems to put them out of the "range" of Hester's sin:
The age had not so much refinement, that any sense of impropriety restrained the wearers of petticoat and farthingale from stepping forth into the public ways, and wedging their not unsubstantial persons, if occasion were, into the throng nearest to the scaffold at an execution. [bold/italics mine]
It's easy to judge others for sins that we can no longer see ourself committing; in fact, the most sympathic among the women are the young who, perhaps, have only too familiar acquaintance with Hester's sin.
Ah, but,” interposed, more softly, a young wife, holding a child by the hand, “let her cover the mark as she will, the pang of it will be always in her heart.