(image CFC original)
Back in the day here in Ohio, you couldn't buy alcohol before 1pm on a Sunday (certain stores: NO ALCOHOL ON JESUS DAY). Now it's settled down a bit, but there are still these "blue laws" on the books to keep us from buying (state-controlled) liquor on a Sunday or Federal holiday.
Anything under the flag of "Blue Laws" tend to refer to control of alcohol or relate to antiquated "still on the books" stuff like banning sodomy. Some (more British) phrases speak of porn as "blue movies." So, clearly, any laws that are "blue" have something to do with sin and punishment.
But Why "Blue"?
If you read your terrible internets or emails from Uncle Joe, you may believe that they were called "blue laws" because "back then" they were printed on blue paper. And if you take that in without question, I've a cousin in Nigeria who wants to send you $5,000,000.
I did a minimal amount of searching and found this article on Snopes.
The listing talks about the Puritan colony of Connecticut and that "the Reverend Samuel Peters' 1781 book, General History of Connecticut, described onerous colonial laws in the following manner:
Blue Laws; i.e. bloody Laws; for they were all sanctified with whipping, cutting off the ears, burning the tongue, and death.
Okay, Still, Why Blue?
In the sordid etymology of "bloody," there are many considerations put forth about how people changed "hell" to "heck" and "Christ" to "Crikey" and "God" to "Gosh" in the avoidance of swearing or taking the Lord's name in vain.
Now this is entirely English-degree speculation, but I propose the Puritans did the same to the second degree: While "bloody" laws was a fine descriptor, as noted above, with a British origin, "bloody" also has many secondary, swear-y, uses, even if it is a first-tier morphology to avoid directly referring to the Virgin Mary or the Blood of Christ. So they switched it up to "blue."
Wouldn't want to be punished for a "bloody law" because you said "bloody law," right?
That's the linguistics and my own extension, but what do you think?