Deliver such a one to Satan for the destruction of the flesh, that his spirit may be saved in the day of the Lord Jesus.
1 Corinthians 5:5 (NKJV)
Sometimes we close our eyes to certain passages or verses of the Bible because we don't like the idea they convey or because we have an erroneous interpretation of them. Often the interpretation or explanation we are given of these passages is out of context. Despite this, we use them to believe that the Bible contradicts itself.
When Paul speaks of handing over such a man to Satan for the destruction of his flesh, this is not a statement to be taken literally. It is rather a way of saying that if a brother, after having sinned, does not repent, he must be cut off from the community of the church. Maybe he will repent. "Cutt off" means removing him from spiritual authority.
Jesus Christ gave us the method to correct a sinner in Matthew 18. Verse 17 has the same conclusion as Paul: “If they still refuse to listen, tell it to the church; and if they refuse to listen even to the church, treat them as you would a pagan or a tax collector [NIV]." The idea of these passages and many others does not encourage revoking his membership in the church, but rather taking disciplinary measures that will make him realize his sin and repent.