All excommunications are meant to be medicinal. They are a kind of shock therapy intended to make sinners aware of the seriousness of their sin and their spiritual condition and call them to conversion.