I got this from:
www.newadvent.org
Right of the Church to Excommunicate
The right to excommunicate is an immediate and necessary consequence of the fact that the Church is a society. Every society has the right to exclude and deprive of their rights and social advantages its unworthy or grievously culpable members, either temporarily or permanently. This right is necessary to every society in order that it may be well administered and survive. The fundamental proof, therefore, of the Church’s right to excommunicate is based on her status as a spiritual society, whose members, governed by legitimate authority, seek one and the same end through suitable means. Members who, by their obstinate disobedience, reject the means of attaining this common end deserve to be removed from such a society. This rational argument is confirmed by texts of the New Testament, the example of the Apostles, and the practice of the Church from the first ages down to the present. Among the Jews, exclusion from the synagogue was a real excommunication (Esd., x, 8). This was the exclusion feared by the parents of the man born blind (John, ix, 21 sq.; cf. xii, 42; xvi, 2); the same likewise that Christ foretold to His disciples (Luke, vi, 22). It is also the exclusion which in due time the
Christian Church should exercise: “And if he will not hear the church, let him be to thee as the heathen and publican” (Matt., xviii, 17). In the celebrated text: “Whatsoever you shall bind upon earth, shall be bound also in heaven; and whatsoever you shall loose upon earth, shall be loosed also in heaven” (Matt., xviii, 18; cf. xvi, 19), it is not only the remission of sins that is referred to, but likewise all spiritual jurisdiction, including judicial and penal sanctions. Such, moreover, was the jurisdiction conferred on St. Peter by the words: “Feed my lambs”; “feed my sheep” (John, xxi, 15, 16, 17). St. Paul excommunicated regularly the incestuous Corinthians (I Cor., v, 5) and the incorrigible blasphemers whom he delivered over to
Satan (I Tim., i, 20). Faithful to the Apostolic teaching and example, the Church, from the very earliest ages, was wont to excommunicate heretics and contumacious persons; since the fourth century numerous conciliary canons pronounce excommunication against those who are guilty of certain offences. Of the facts there can be no doubt (Seitz, Die Heilsnotwendigkeit der Kirche, Freiburg, 1903).