In the world of sport, a club which regularly finished top of the league at junior and senior levels, season after season, would be a dominant force. So Catholic schools in Scotland should be in high spirits. Under new school inspection arrangements, their establishments are regularly crowned the best in the country.

In March, St Mark's Primary School in Barrhead in East Renfrewshire received 11 excellent ratings, the best ever for a Scottish school, overtaking Our Lady of the Mission, Thornliebank from the same authority.

In the secondary sector, both St Ambrose High School in Coatbridge and St Andrew's Secondary School in Carntyne, Glasgow, received five indicators of excellence. The inspectors singled out pastoral care for particular praise in each of these schools. The achievement is all the greater for the fact that several of the schools serve mixed communities, including areas of deprivation.

Yet Catholic schools in Scotland are in a paradoxical position. At a time when individual schools are receiving glowing inspection reports and attracting large numbers of non-Catholics through their gates, their right to exist is being questioned.

The Green Party's election manifesto for the recent Scottish Parliamentary elections explicitly questioned the future of Scotland's 390 state-run Catholic schools, with the result that two Catholic head teachers wrote to parents asking them not to vote Green. Meanwhile, the president of Scotland's largest teaching union has also called for an end to the right of veto the Catholic Church has over the appointment of teachers in Catholic schools.

Earlier this month, professor John Haldane, of St Andrews University warned the Catholic Headteachers' Association of a "determined effort to purge the public space of Catholic education".

So why are Catholic schools so successful? And do they have good reason to be so anxious?

Michael McGrath, director of the Scottish Catholic Education Service, believes the quality of education in Catholic schools stems in part from having a coherent and consistent ethos, which in turn builds upon a sense of kinship within the school.

He says they have a strong sense of community: "The school is working with parents, teachers and pupils and has strong links to local churches. The very strong relationships which are fostered between home and school, and school and the community build a strong ethos of working together to address the full development of children."

McGrath, who was head teacher at Our Lady's High School in Cumbernauld for seven years, believes the excellent ratings received for pastoral care within Catholic schools derive from the Christian values which underpin them. "The schools have a strong sense of shared values built around Christian values. Often pastoral care is commended in inspector's reports where the school offers support to all young people within a system of discipline and dignity."

So could a similar strong ethos exist in schools without the religious element? McGrath thinks not: "Religion is not a single thing in school that is "done" in the RE lesson, but is part of the fabric, life and culture of the school. It's a fairly intricate weave of a whole range of threads."

This sense of community also has a positive effect upon behaviour within the schools, he argues.

Judith Gillespie, of the Scottish Parent Teacher Council says the success of Catholic Schools can be replicated elsewhere but only by replicating their key features: "One of the most significant things about the success of Catholic schools is that parents who send their children there have made a positive choice in choosing that school, and they are quite often then quite involved," she argues. "There is a lot of evidence which shows that when parents are involved in their children's education, the children tend to do well."

Catchments are relevant too, Gillespie adds. "A non-denominational school will have a much smaller catchment area. If it is an area of deprivation then the non-denominational school will only have pupils from the deprived area whereas the Catholic school will be drawing pupils from a range of backgrounds. And deprivation is one of the most significant factors for children not doing well at school."

"I think when you look at other schools which engender a sense of community - a rural school or a school with a lot of parental involvement - these schools probably match up to what happens naturally in a Catholic school."

Eric Wilkinson is professor of education at Glasgow University, the teacher training institution for the majority of Catholic teachers in Scotland. He says Catholic schools have evolved to fit themselves for the 21st century.

He explains: "Catholic schools have changed considerably, as have all schools in the last 20 to 30 years. In the past they used to be quite authoritarian but are more humane now and are less rigid."

Wilkinson believes that the strength of ethos in Catholic schools may be due to the common identity created by being followers of the same faith. He adds that it was perhaps not the actual religious belief which creates the glue, but rather this sense of community.

However, Professor Wilkinson welcomes the debate on the future of Catholic schools, saying: "Personally, I do not accept religion has anything whatsoever to do with education, other than for historical and cultural reasons. With a new Parliament being sworn in, this seems to be an appropriate time to have a rational and reasoned debate."

Professor Haldane fundamentally disagrees with Professor Wilkinson's stance, He argues that education cannot be divorced from values and excluding religion from schools is as controversial as including it.

He says: "The context of education is value-laden. What values do you teach? The values you believe to be the truth. Education is too important not to engage with serious issues and it would be irresponsible not to draw upon one's most deeply-held convictions when educating young people."

McGrath, director of the Scottish Catholic Education Service, certainly believes the current Catholic school system, established in 1918, is at risk from outside secular forces.

He said: "I think the forces of secularism are quite aggressively trying to confront the place of faith in today's society."

One such challenge to the status quo was won by teacher David McNab, who successfully overturned a church veto on his right to apply for a pastoral care post in St Paul's High School in Glasgow last year, a victory confirmed on appeal in February.

Brian Napier QC, for Mr McNab, thinks the case could have important implications for teachers in Catholic schools, rendering an 1991 agreement between the church and local authorities unworkable. He says: "My view is that the McNab case itself, while very much turning on particular facts special to St Paul's school, is an important decision for the future of jobs in Catholic schools in Scotland."

"The decision of the Employment Appeal Tribunal shows the argument that the agreement made between the Catholic Church and Strathclyde Council in 1991 has carved out a general exemption permitting religious discrimination in jobs, is not going to work."

Napier adds: "The Employment Appeal Tribunal also accepted that neither Glasgow City Council nor Education Department had any business having an ethos, something which makes it more difficult for them to rely on exemption from the 2003 regulations."

Peter Quigley is president of the Educational Institute of Scotland (EIS), Scotland's largest teaching union, which has regularly called for an end to the veto awarded to Catholic education authorities over the appointment of non-Catholic teachers. He says: "How can members of any religious denomination pass judgment on members of another denomination? Why should people justify their beliefs to get employment?"

But Mr McGrath says that the argument about approval has more sinister undertones: "The criticism about approval is a flag of convenience underlying an attack on Catholic schools per se. What he Peter Quigley was really calling into question was whether Catholic schools should exist at all.

"The church has a right to ensure that the teachers who work in Catholic schools are supportive of what they are about. This is not about discrimination or trying to reserve jobs for Catholics.

"It would be a huge contradiction in terms if someone working in a Catholic school said I don't believe in God and I don't agree with Catholic schools'.

"It would be like a vegetarian working in McDonald's."

Meanwhile, Catholic schools continue to be successful in another area. As inspection reports give them the seal of approval, they continue to attract parents from other faiths and none, to the extent that, in some schools, the majority of the roll is non-Catholic.

McGrath welcomes this interest from outside the church community, he says. "The parents don't want their children to become Catholic per se but they recognise the values of respect for life, supporting your community and supporting the deprived, coupled with the importance of discipline and moderation."