The concept of a ‘Blue law’ has a puritan background, from Massachusetts Bay colony (I found a reference to New Haven colony also. It was probably common in different colonies.) A “blue law” refers to an edict designed to regulate public activities on the Sabbath, which meant Sunday to the Congregationalists of that day.
Why ‘blue’ though?
The origin of the term blue law is disputed. Many authorities have argued that some of the early laws, or a book describing the regulations, were printed on blue paper.
Pretty simple, right? Blue papers, blue laws.
This information (along with much more on the topic) courtesy of u-s-history.com.