NSS executive director Keith Porteous Wood welcomes the Irish referendum result on marriage equality and argues that the Catholic Church's appalling recent history in Ireland shows it deserves to be discredited- as it now has been, by the overwhelming referendum "Yes" result.

Last week, Ireland's citizens voted in a landslide to legalise same-sex marriage. Unsurprisingly, the constituencies most in favour of "Yes" were within 50 miles of Dublin followed by the larger cities. Those least in favour tended to be nearest to the meandering border with Northern Ireland, probably with a higher proportion of protestant voters. Variations in the percentage of turnout did not impact on the overall result. More rural areas tend to be less in favour, but not always. While the very rural Mayo and Galway East were only just in favour, the even more remote Galway west was over 60% in favour.

The major lessons of the Irish referendum endorsement of same sex marriage by nearly 2:1 are religion-connected.

Primarily, it showed just how out of step the Catholic Church is with the Irish population. Even more striking is the speed with which this country, so recently completely in hock to that same Church, has changed diametrically. Diarmuid Martin, Archbishop of Dublin, notably more realistic than many of his episcopal brethren, recognised that the Referendum signified a "social revolution" that did not happen in one day. Indeed.

In 1990 the Republic of Ireland had the highest proportion of weekly church attendance in Europe. At over 80%, it was in a class of its own; the next European contender was "only" 41%. An expert in religious statistics, Dr Peter Brierley, wrote just fifteen years ago that "the Irish Republic is the most religious country … in the world [I imagine he meant "Christian"] … with (in 1995) 98% professing an allegiance to a Christian church and 87% to the Catholic Church".

Yet it wasn't many years later that the Catholic commentator Mary Kenny first bemoaned that Ireland had become "post-Catholic"; she now regards it as sometimes "anti-Catholic". Crucially, her Post Christian comment was made before public awareness had been raised about clerical child abuse in Ireland.

But the Church's reputation had a lot further to fall with the constant drip feed of atrocities culminating and the dawning realisation that measured relative to its population, reported clerical child abuse is Ireland the highest in world. The referendum result is in part the Church paying the price for its shameless role in facilitating the continuation of that child-rape, sheltering clerical child-rapists from justice and denying justice to the victims. They were often punished for speaking out and told they were lying. To this day, the Church continues to fight tooth and nail every case and any compensation.

The Irish people were no less disgusted when the Papal Nuncio refused to give evidence to a Commission on child abuse, claiming diplomatic immunity. In 2011 Taoiseach (Prime Minister) Enda Kennedy famously reportedly "accused the Vatican of covering up for paedophile priests in Ireland only three years [earlier]" precipitating the Nuncio's recall to the Vatican, after a groundswell calling for his expulsion.

Until then the Church had got away with everything; religious influence on the Government had been total, the very antithesis of secularism.

But even this unprecedented, and indeed previously unthinkable, public castigation certainly didn't lead to humility, if anything the opposite.

In 2013 the Irish Catholic Bishops' Conference, in an attempt to derail same sex marriage plans, threatened the Government. In a submission to the Constitutional Convention on same sex marriage it warned: "... if there were two totally different definitions of marriage the Church could no longer carry out the civil element".

As there are few civil registrars in Ireland, this would cause a major problem. Despite this, the Convention came out in support of same sex marriage which led to the Referendum. So the Church, shamelessly, tried again. The Tablet reported shortly before the Referendum that the "Church in Ireland threatened not to carry out the civil registration formalities customary at the end of Catholic marriage ceremonies". This was once again to no avail. Surely, having made the dire threat twice – is "blackmail" too strong a word? – and having been so completely ignored, has the Church not demonstrated its impotence more effectively than if it had not made the threats?

The Church presumably did however realise that bullying voters, perhaps declaring that to vote "yes" would be a mortal sin, would not work. Seemingly at least some in the Church realised how little influence clerical pleading would have, and accordingly largely subcontracted the campaigning to lay organisations such as the Iona Institute.

I accept that it was an uphill task arguing to denying equality to people in love who the Church still considers to be "intrinsically disordered" and has historically vilified, and worse. And the coming out stories precipitated by supporters of a 'Yes' vote would turn all but the most stone-hearted. But these lay organisations could hardly have made a worse mess of boosting the opponents. Their campaigns were not only negative, they were gratuitously insulting and economic with the truth to the point of parsimony. They even questioned whether prominent proponents "had rejected their faith". They scaremongered baselessly about the loss of religious freedom and attacked same sex adoption, despite it not being affected by the Referendum. And the disingenuousness simply drove voters all the harder to tick 'Yes' box, while turning the population even further from the Church.

The second, even more painful, lesson for the Church in the longer term is that it was the young who were so overwhelmingly supportive of a 'yes' vote. Some travelled huge distances to register their vote. Touchingly, they dubbed the last Republic-bound boat train from London's Euston before the vote as the "Equality Train" and sent selfies to their friends.

Memorably, Archbishop Martin was asking himself: "most of these young people who voted 'yes' are products of our Catholic school system for 12 years. I'm saying there's a big challenge there to see how we get across the message of the Church".

If twelve years indoctrination has turned the youth, Ireland's future, against the Church, the only way they could be brought back, if it is possible at all, is for the Church to change out of all recognition. And that is beyond the Archbishop of Dublin.

The final lesson is that this calls "time" on Northern Ireland's refusal to allow same sex marriages, the only part of the UK not to have them.

Spain and Portugal, France, Benelux and Scandinavian countries have them and the populations of Germany and Italy are in favour of them.

But it will be a hard battle; there was a clue in the Republic's constituencies near the Northern Ireland Border being least keen to vote 'yes'. And the politicians in the DUP, Northern Ireland's leading party, are even less keen than their supporters, and the Party has a veto. So this looks like having to be resolved in the courts, or even Strasbourg.

It is only 100 miles between Dublin and Belfast, and the enthusiastic Referendum result has made the likelihood of a positive outcome in Northern Ireland much more likely, and urgent. The pressure is already building up.

And maybe the ease with which this referendum passed suggests an attempt should be made to liberalise, or even humanise, the Irish Republic's absurdly restrictive abortion laws, where abortion is in practice means-tested - restricted to those who can afford to have this undertaken abroad. Every year thousands do make these lonely journeys, and others submit themselves to back street abortions.

Keith Porteous Wood is the executive director of the National Secular Society. The views expressed in this article are those of the author and do not necessarily represent those of the NSS.

The below table indicates how the vote broke down in descending order of % "Yes" vote in each constituency.