In Hawthorne's novel The Scarlet Letter, one can look at the antagonist as the Puritan society. There are a few different ways the Puritan society could function as the villain based upon their ideologies.
First, the Puritans functioned under a Theocracy. A Theocracy was a government which combined both the Church and the state. Therefore, laws were constructed based upon God's law and enacted with the force of a typical government. By traditional law, it is not "illegal" to commit adultery. Unfortunately, as seen in the case of Hester, adultery is illegal according to the Puritan Theocracy. Therefore, Hester is governed by both God's law and the law of the government--which are the same.
Second, given that society makes the rules, Hester is able to be shunned by the community given her breaking of the law. It is the society, based upon the following of God's law, which forces Hester to be ostracized. Her "exile" from the community is based upon the strict ideology of the community.
Overall, Hester is abandoned by the entire society which she lives in. Therefore, the society is what is set up against Hester and, therefore, functions as her antagonist.