From Ed Peters, distinguished canonist, on Catholic SCOTUS Justices (Kennedy, Sotomayor) who ruled for Obergefell v. Hodges:

Obergefell and canonical criminal law

Dcn Greg Kandra calls attention to a question floating around out there, namely, [QUAERITUR…]should Catholic justices who voted to impose “same-sex marriage” on America be excommunicated? We can deal with most of that question pretty quickly.

Excommunication can impact any Catholic (there are no exemptions for those in high civil office), but it can be incurred only for twelve specifically delineated crimes (CLSA Comm. 932, not counting a couple of excommunicable crimes listed outside the Code). Now, voting to impose “same-sex marriage” on a nation (or, taken more broadly, gravely damaging the common good) is not among the canonical crimes punished by excommunication, and even Canon 1399 (sometimes derided, if unfairly, as a “catch-‘em-all” penal norm) would not suffice for so-called automatic excommunication (a canonical institution that presents its own legal complications, but let that pass). In short, I see no excommunication readily imposable on Catholic justices who voted to impose “same-sex marriage” on America.

But, [But…] two points remain for Catholics to consider.

1. For reasons outlined here (chiefly that—aside from the compelling natural law demonstration that marriage is possible only between a man and woman, a demonstration that should be understandable as a matter of human reason—the Church teaches with infallible certainty that marriage is possible only between a man and woman) I think that some Catholic justices have, indeed, manifested their opposition to Church doctrine (Canons 750 § 2 and 1371, 1°), doing so, moreover, “in published writing” and in a way that “gravely injures good morals” (Canon 1369). The canonical sanctions referenced for such offenses are, however, ‘indeterminate’ (justa poena) and, I would hold, do not extend to excommunication. To be sure, a number of very important procedural steps would need to be observed before moving on these norms (and the track record of thinking-through, let alone enforcing, penal canon law has not been strong in our day) but, [But…] at the very least, the fact that such an argument can even be made suggests a basis for some kind of pastoral intervention toward those Catholic justices who hold that “law can recognize as marriage whatever sexual attachments and living arrangements it wishes”, let alone toward those who voted to impose “same-sex marriage” on America.

2. If, as seems likely, Church teaching that marriage can exist only between a man and woman is taught not just infallibly (as a ‘secondary object’ of infallibility) but as being divinely revealed (making it a ‘primary object’ of infallibility), then, a Catholic’s obstinate denial of such a truth is canonically “heresy” (Canon 751) punishable by excommunication (Canon 1364 § 1), an automatic one at that—and is not just ‘opposition to Church teaching’ punishable by a ‘just penalty’. I leave it to theologians to hammer out whether Church teaching on the male-female foundation of marriage is simply, but infallibly, Church doctrine (I am sure it is at least that) or whether it is part of divine revelation (I am strongly inclined to say that it is), but either way, prominent Catholics asserting that marriage is whatever the State wants to make it, is a grave ecclesiastical problem.