Every code of laws is underpinned by some set of ethical values. In Europe before the 19th Century, it was usually underpinned by one or another variants of Christianity. Our own common law traditions were derived from English common law, which in turn was partially based on Biblical principles. Until the 20th Century, blasphemy, e.g., taking God's name in vain, was a punishable offense in several states. For hundreds of years, the Catholic Church was the monopoly religion in Western and Central Europe. After the Reformation, the Protestant state churches in England, Scotland, northern Germany, and Scandinavia replaced the Catholic Church. The theology changed, but not the legal codes that penalized heresy, except Catholicism was now regarded as heretical. Granted, the churches approved of civil heresy trials, much as the Communist Party in the USSR and its satellites approved of state persecution of dissidents.
Thankfully, the Constitution limits the ability of the Federal and state governments in the suppression of free speech in America. However, that limitation did not prevent the Clinton and Obama administrations to use the IRS and other agencies to harass and try to bankrupt opposition groups. Further back, Communists, anarchists, Nazis, and others were suppressed by Federal and local authorities.