VIII. Excommunication should be inflicted only on those who are guilty of some great crime, and even then not hastily.
No Christian should lightly be denied communion, nor should that be done at the will of an angry priest which the judge's mind ought to a certain extent unwillingly and regretfully to carry out for the punishment of a great crime. For we have ascertained that some have been cut off from the grace of communion for trivial deeds and words, and that the soul for which Christ's blood was shed has been exposed to the devil's attacks and wounded, disarmed, so to say, and stript of all defence by the infliction of so savage a punishment as to fall an easy prey to him. Of course if ever a case has arisen of such a kind as in due proportion to the nature of the crime committed to deprive a man of communion, he only who is involved in the accusation must be subjected to punishment: and he who is not shown to be a partner in its commission ought not to share in the penalty. But what wonder that one who is wont to exult over the condemnation of priests, should show himself in the same light towards laymen.
Source: Letters (New Advent)