In Chapter XX, Hawthorne writes,
No man, for any considerable period, can wear one face to himself, and another to the multitude, without finally getting bewildered as to which may the true.
The sanctimonious hypocrisy is a motif that runs throughout the narrative of The Scarlet Letter. For example, Governor Bellingham, who is the leader of the Puritan community, has articles of war (armor) in his elaborated designed house with stained glass windows and other ornate structures--contrary to the plainness and simple attributes demanded by Puritanism. His own sister is a witch who attends the black mass in the forest.
So, in the final chapter, Hawthorne openly declares his theme and moral:
Be true! Be true! Be true! Show freely to the world, if not your worst, yet some trait whereby the worst can be inferred!
This moral is underscored in the characters of Hester and the Reverend Arthur Dimmesdale as it is Hester who survives and gains a place in her community, but Dimmesdale is destroyed by the guilt of his secret sin.