This is called as excommunicate.
An excommunicated person no longer have the rights to go to church and take part of any religious activities or practices.
A violation of church policies or guidelines can be a basis for this judgement to someone who has committed it.