Question: "What does the Bible say about church discipline / excommunication?"
Answer: Excommunication is the formal removal of an individual from church membership rolls and the informal separation of company from that individual. Matthew 18:15-20 gives the procedure and authority for a church to do this. It instructs us that one individual (usually the offended party) is to go to the offending individual. If he/she does not repent, then two or three go to confirm the situation and the refusal to repent. If there is still no repentance, it is taken before the church. This process is never "desirable," just as a parent never delights in having to discipline his/her children. Often, though, it is necessary. The purpose is not to be mean-spirited or to display a "holier than thou" attitude. Rather, it is to be done in love toward the individual, in obedience and honor to God, and in godly fear for the sake of others in the church.
The Bible gives an example of the necessity of excommunication in a local church, the church at the city of Corinth (1 Corinthians 5:1-13). In this passage, the apostle Paul also gives some purposes behind the biblical use of excommunication. One reason (not directly found in the passage) is for the sake of the testimony of Christ Jesus (and His church) before the unbelievers. When David had sinned with Bathsheba, one of the consequences of his sin that God mentions is that the name of the one true God will be blasphemed by God's enemies (2 Samuel 12:14). A second reason is that sin is like a cancer; if allowed to exist, it spreads to those nearby just as a little yeast leavens a whole loaf of bread (1 Corinthians 5:6-7). Also, Paul explains that Jesus saved us so that we might be set apart from sin, that we might be "unleavened" or free from that which decays spiritually (1 Corinthians 5:7-8). Christ's desire for His bride, the Church, is that she might be pure and undefiled (Ephesians 5:25-27). Excommunication is also for the long-term welfare of the one being disciplined by the church. Paul, in 1 Corinthians 5:5, states that excommunication is a way of delivering "such a one to Satan for the destruction of the flesh, that his spirit may be saved in the day of the Lord Jesus." This means that excommunication can somehow involve God using Satan (or one of his demons) as a disciplinary tool to work in the sinner's life physically to bring about true repentance in his/her heart.
Sometimes the disciplinary action of the church is successful in bringing about godly sorrow and true repentance. When this occurs, the individual is able to be restored to fellowship. The individual involved in the 1 Corinthians 5 passage repented, and Paul encouraged the church to restore him to fellowship with the church (2 Corinthians 2:5-8). Unfortunately, the disciplinary action, even when done in love and in the correct manner, is not always successful in bringing about such restoration, but is still needed to accomplish the other good purposes mentioned above.
We have all likely witnessed the behavior of a child who has been allowed to do as he/she pleases with no or very little consistent discipline. It is not a pretty sight! Nor is such parenting loving for it dooms the child to a dismal future. Such behavior will keep the child from forming meaningful relationships and performing well in any kind of a setting, whether socially or in an occupation. In a like manner, discipline in the church setting, while neither enjoyable nor easy, is not only necessary, but loving as well. Moreover, it is commanded by God.