The Church of England has voted overwhelmingly in favour of legislation to bar clergy from joining racist or discriminatory political parties.

On the second day of the General Synod, the church's legislative body, members voted by a huge majority to declare that allegiance to a party whose policies are "incompatible with the teaching of the Church of England in relation to the equality of persons or groups of different races" would be "unbecoming and inappropriate".

Although the church has not named names, the legislation was born out of a motion proposed in 2009 by Vasantha Gnanadoss, a Metropolitan police civilian worker and Synod member who warned of the potential for the British National party (BNP) to grow in influence. "Passing this motion is a push that is seriously necessary," she told the Synod at that time.

Under the proposals, bishops would have to declare a particular party to be incompatible with the church's teachings.

Speaking before Synod on Saturday, the bishop of Guildford, the Rt Rev Christopher Hill, said the legislation was "about something of vital importance to the body of Christ: our care and concern for the equality of all human beings as created by God and redeemed in Christ".

In an interview, he said that the measure was at this stage hypothetical as no members of the Church were known to be members of such parties, which have not been officially identified. But, he said, it was an important symbolic stance. "We felt we had we had to do this in principle because some people are claiming the name of Christianity for obnoxious social teaching against Christian faith and … against the common good and equality."

The BNP has condemned the ban, insisting that changes in its constitution mean it is not a non-discriminatory organisation. A spokesman accused the church of "bullying and persecuting … individual people on the basis of what they think".

He added that "if the right set of circumstances came about and the individual sought help from the party" the BNP would not rule out taking legal action. William Fittall, secretary general of the Synod, has in the past warned that such a ban could prove legally problematic.

The move, which formed part of a wider piece of legislation concerning conduct of the clergy, received unanimous support from the house of bishops and the house of clergy. In the house of laity, 100 voted for the legislation and two against. There was one abstention.