Generally speaking, Colonial America would not have existed if not for religion. It was to escape religious persecution that the Puritans left England for the New World. They decided to settle in North America in what would eventually become the eastern United States. The Puritans were a sect of Christianity that sought to split from the Anglican church. In the American colonies, there was a general expectation that citizens would follow strict religious observances. But, as with the differences that caused tension in England, newcomers to the colonies sometimes sought to establish or follow religious paths that differed from the prevalent denominations. In some cases such dissenters faced the same sort of persecution in the colonies they had sought to escape by leaving England.
The difficult living conditions (harsh climate, inability to maintain livelihoods at the level they did in England) in the colonies were exacerbated by these religious tensions. In some communities, resentment toward clergy was strong (since citizens were required to pay part of their taxes to support clerical salaries, even if the citizens did not follow those particular church's teachings). In Salem Village near Boston, these tensions were also affected by deep superstitions about witchcraft and magic, and eventually led to the accusations, imprisonment and execution of eighteen citizens for the crime of witchcraft.
There was also a relative shortage of clergymen, and some rural communities were so spread out that any kind of regular church attendance or solidity of a religious community was difficult to establish. But expectations of "moral" behavior were widespread, and activities such as drinking, gambling and infidelity were frowned upon as being sinful, especially on the Sabbath day, and many communities passed laws to reflect this belief. Some of these so-called "blue laws" stayed on the books in Massachusetts well into the 20th century.