Pointless. So you punish Catholic politicians by enforcing Church doctrine. The problem for many years for Catholic Americans was convincing others that they were not Catholic first, American by happenstance. Punish them by un-electing them.
Public excommunication would help in getting them unelected. But more to the point, it’s something that should be done to try to save their souls.
I’d like to see a similar movement regarding nominally Orthodox Christian politicians who support abortion (Sarbanes comes to mind, though he’s left public office).