In my opinion as a reader, the prison gates symbolize the Puritan lifestyle, it is confining and condemning, just like a prison sentence. In most any other culture or even Christian faith, there is a process for the washing away of sins. Not so in the life of a Puritan. It feels like a permanent life sentence. If good deeds can't pay for the sin, then something else will have to do it, like fasting. If that doesn't work, a 24-hour prayer vigil must be held. If that doesn't fix the problem, something different must be tried.
It has to feel imprisoning to live like that. To live with so many rules that you can't feel comfortable to be yourself or have your own identity would kill people in our culture today. In fact, the Salem Witch Trials is often said to have been sparked by the boredom of teenage girls. Had their been opportunity for these girls in that society to express themselves, they would not have had to go to great lengths like they did to entertain themselves.
Hester experiences this imprisonment her whole term throughout our book. Even though she is convicted of a crime and duly punished, the book does offer a time in which she is free, but a question remains. Does she really feel free from the society's judgement, free from a lifestyle of retribution to God? It is hard to find.
Having these prison gates at the beginning foreshadows what is to come for the book's main character, Hester Prynne.