I can pose the question in these precise terms. Consider a law X that is designed to punish people who do or don’t do Y with imprisonment or confiscation of property.
The Church could take one of three positions:
Catholics are free to support or oppose the law X.
Catholics must oppose the law X.
Catholics must support the law X.
Note that it is certainly not the case that the above is a strict funciton of what the Church teaches about Y. The Church might teach that to do or not do Y is a grave sin and yet take position 1 or even 2 above.
Here are some of the thoughts of St. Thomas Aquinas on the subject: “The law which is framed for the government of states, allows and leaves unpunished many things that are punished by Divine providence. Nor, if this law does not attempt to do everything, is this a reason why it should be blamed for what it does. Wherefore, too, human law does not prohibit everything that is forbidden by the natural law.”
On the subject of vices (i.e. sins):
“It seems to me that the law which is written for the governing of the people rightly permits these things, and that Divine providence punishes them. … Human law rightly allows some vices, by not repressing them.”
“Human law is framed for a number of human beings, the majority of whom are not perfect in virtue. Wherefore human laws do not forbid all vices, from which the virtuous abstain, but only the more grievous vices, from which it is possible for the majority to abstain; and chiefly those that are to the hurt of others, without the prohibition of which human society could not be maintained: thus human law prohibits murder, theft and such like.”
“The purpose of human law is to lead men to virtue, not suddenly, but gradually. Wherefore it does not lay upon the multitude of imperfect men the burdens of those who are already virtuous, viz. that they should abstain from all evil. Otherwise these imperfect ones, being unable to bear such precepts, would break out into yet greater evils.”
“…those who are in authority, rightly tolerate certain evils, lest certain goods be lost, or certain greater evils be incurred: thus Augustine says (De Ordine ii.4): If you do away with harlots, the world will be convulsed with lust.”
Summa Theologica, I-II, q. 96, a. 2, and II-II, q. 10, a. 11 The 2nd Vatican Council also says this on the subject: “This Vatican Council likewise professes its belief that it is upon the human conscience that [religious] obligations fall and exert their binding force. The truth cannot impose itself except by virtue of its own truth, as it makes its entrance into the mind at once quietly and with power.” Declaration on Religious Freedom #1.
Saint Thomas is always a good starting point, and these quotations are exactly relevant, but I wonder who has weighed in on this more recently.
Also, just working from his points, abortion is an interesting subject. Unlike murder, it is very much in dispute and although Catholics are clear on it most people do not regard it as murder for one reason or another. Does this fact suggest that laws against abortion are premature?
In the area of homosexuality, things seem to be going backwards. Does the growing support for same sex marriage mean that it should be legalized?
Thomas’ other criteria, the sustainabilty of society, is relevant to both above but there again we face the problem of popular understanding. Both abortion and homosexual relationships (and many other social maladys) lead to a birth dearth and an aging, perhaps decaying, society. But there are many who view that as a good thing and population growth as a problem to be solved.