Hawthorne often used the Salem/Puritan setting in his novels. His ancestor, Major William Hathorne was among the first Puritan settlers to arrive in America. Many of Hawthorne's stories are analyze the sins of his ancestors, exploring the themes of guilt, hypocrisy, hidden sin. His stories are often told in allegorical form; they contain both symbolic and literal meanings.
The characters in the Scarlet Letter, like those in many of his novels battle the good and evil within themselves, but the main theme of this novel is without doubt the feelings of guilt and remorse. Hawthorne himself, was also torn by these feelings, something that stemmed from his own Puritan roots. His friendship with Ralph Waldo Emerson and other transcendentalists led him to rethink his ideas, after which he embraced contemporary......... albeit guiltily.
The Scarlet Letter was heavily based on the actions of John Hathorne, Nathaniel's great-great grandfather. John was looked up to as a successful Salem merchant and politician; he also acted a the 'witch judge' in the Salem trials, during which he was responsible for the questioning of Tituba, Sarah Good, and Sarah Osborne. When Sarah Good pronounced a curse on those responsible for her false execution just before her death......... the Hathorne was indeed cursed. The family believed itself to be a part of that curse, and the novels written by Nathaniel Hawthorne seem to speak from the ancestral guilt of John's actions.
So, in answer to your last question; No, Hawthorne did not favor public humiliaton, and yes, he is being critical of the religious influences under which he's been raised. I think this novel was a double-edged sword for him.