Jesus did not advise excommunication.  I suppose you refer to Mt 18:17 where Jesus says treat them as you would a tax collector. But Jesus is talking to his disciples. In all things, the disciples are supposed to follow the Way of their Teacher. Notice that passage starts out with "if your brother sins against you," and concludes with "forgive 70 x 7." So this is a passage about forgiveness. It is followed by the story of mercy where the servant fails to forgive. Disciples were servants of their Master -- those who do not show mercy and forgive are not worthy servants.  Also, do you recall that Jesus dined, not just with tax collectors, but also with Pharisees (Lk 7:36), with whom he disagreed. Jesus did not shun those he disagreed with. Instead he DINED with them.   So treat them like taxcollectors means - go dine with them.