ok I was not clear. I should have said that the purpose of canon law is the salvation of souls. by and large  penalties  exists to be medicinal - to restore the person to grace ( for want of a better word) and to protect the innocent. excommunication is fundamentally to eject someone from the church in the hope that feeling the loss of fellowship and eucharist the person will correct what is necessary and come home. excommunication is not at its base punitive. 

a former student with whom I worked closely committed suicide which was caused by mental illness that I was convinced was set off by his being sexually abused by a priest who was celebrated for his insightful rhetoric in a portion of the catholic church in this country.

for about 15 years I was infuriated by what happened to him and to others whose stories I was to learn. over the past year or so as we were working through the gospel of luke in the sunday gospels I became convinced that my reaction was inconsistent with it