1. A virtue is a settled habit of the mind by which one tends (easily, readily, cheerfully) to act well, toward one’s perfection and ultimate happiness.
2. Virtues are divided according to the two faculties of the mind: the apprehensive faculty (i.e., the intellect) and the volitional faculty (i.e., the will). Among the intellectual virtues are prudence (right reason about things done) and art (right reason about the making of things). Among the volitional (aka “moral”) virtues are justice (the habitual desire to render each one his due), temperance (the habitual moderation of concupiscible appetites in accord with reason) and fortitude (the habitual moderation of the irascible appetites win accord with reason).
3. Justice is about rendering what is due: i.e., it’s about rights, and rights only exist within relationships. The virtue of justice moderates relationships in accord with what is proper to them. Hence we can divide justice into various separate virtues depending on the different kinds of relationships we have and the different ways in which a relationship may need to be respected. (E.g. the virtue of piety concerns the relationship we have to our parents, and secondarily the relationship we have to the state [filial vs. civic piety].) In the field, these are called the “quasi-potential parts” of Justice (if you were curious about the jargon).
4. Now, among these parts of the virtue of Justice, one of them concerns justice in relation to God. Most people in human history have believed (it seems) in God under some aspect or another: a creator responsible for one’s life or existence and the order/government of the world. In accord with this “natural” conception of God shared by most of humanity, there is a natural understanding of what is owed to God. And this is what the natural virtue of religion attempts to respect.
5. Consequently the virtue of religion focuses on what is due to God under a few basic aspects: as the one to whom your life is owed, as a benevolent governor of the world, as supremely good, as perfect witness, as deserving of praise. Obviously to get all of these attributes one needs to be rather skilled at natural theology, and many people have not gotten all of them. Still, they follow with a reasonable degree of clarity from the knowledge that God creates. Particular cultural ties and perversions of local cult may obscure the truth, but imperfection in particular cases doesn’t detract from the fulness of the norm.
6. From these aspects outlined above, we get a few species of the virtue of religion. Acknowledgment of our debt to God for our own life and being inspires Adoration. Recognition that God is a benevolent governor of the world inspires prayer. His benevolence inspires adoration and sacrifice. His role as witness and supreme norm/lawgiver inspires the making of vows to God, or the invocation of the divine witness in oaths to other people. God’s supreme perfection and generosity inspire praise.
7. So now we get to blasphemy. Obviously there are degrees of blasphemy, and the “perfect” form of blasphemy would be not just a violation of natural religion, but a sin against the supernatural virtue of faith. Let’s stick to the former. Here what we mean by blasphemy is a denial of the divine goodness, and thus a belief that God is unworthy of praise. This can be merely intellectual or be accompanied by malice toward God. Clearly the latter case is worse.
8. Now, I believe our original question was about positive human laws against blasphemy. Could there be a reasonable law against blasphemy? Well, a law is a reasonable ordinance for the common good divised by the person/group who has care of the community and promulgated. In Isidore of Seville’s classic Etymologies, he says that laws should be “virtuous, just, possible to nature, according to the custom of the country, suitable to place and time, necessary, useful; clearly expressed, lest by its obscurity it lead to misunderstanding; framed for no private benefit, but for the common good.”
9. The question then is whether a law which defends the natural virtue of religion could fulfill these criteria. Reasonability? yes. Possible to obey? Yes. Just? By definition. Useful? For the promotion of virtue among the people, yes. For the common good? Yep. etc.
10. It seems that reasonable laws prohibiting blasphemy could exist.
N.B. Kevin noted (helpfully) that thoughtcrime is evidently ruled out by I-II q.96 a.2, and I responded that St. Thomas's treatment of regnative prudence (II-II q.50) seems to add to this by presupposing freedom in the governed, which thoughtcrime would tend to obliterate.