“APPALLING” was the SNP’s description of last week’s unanimous UK Supreme Court decision that the two-child limit on child tax credits is lawful. That’s a strong word for a governing party to use about a court judgment – I would prefer the independence of the judiciary and the rule of law to be shown more respect.

The truth revealed by the Supreme Court’s judgment is that those who oppose the two-child limit should legislate to end it, not litigate to have the courts overturn it. It is profoundly a political matter for a parliament, not a legal issue for the courts of law.

Holyrood has all the powers it needs to ensure the two-child limit no longer applies in Scotland, yet the SNP has chosen not to use those powers but instead to campaign on the two-child limit and its associated “rape clause” as a grievance to bash the UK.

If Scotland’s government really cared about the women they say this policy targets, they’d simply legislate to scrap it. But that doesn’t suit them. Far better, in the Nationalists’ view, to keep the policy in place and campaign against it. Readers will judge for themselves whether they find this organised hypocrisy “appalling”.

READ MORE: Children should learn old-fashioned manners, says Maggie Ritchie

It is true that the Smith Commission left most welfare powers in Westminster’s hands. But, crucially, it also insisted that Holyrood be given two powers, both enacted by the Scotland Act 2016 but neither of which, in the years since, the Scottish Parliament has done anything like enough with. The first is a power to top-up any Westminster benefit. Whenever Holyrood thinks that a benefit has been set too restrictively by Westminster, the Scottish Parliament has the power to top that benefit up, circumventing the effects of Westminster’s restrictions.

At the same time, Holyrood also has the power to create any new benefits it wishes within devolved areas. Given that child and family law are devolved (as is housing), the scope of this power is significant.

Either or both of these powers could long ago have been used by ministers to ensure that child tax credits are available to families in Scotland irrespective of the number of children someone cares for. It is a UK policy choice to impose a two-child limit on child tax credits, but it is an SNP policy choice to maintain that limit here in Scotland.

From a Conservative perspective, the two-child limit is clearly a mistake. The political costs generated by the policy far outweigh any gains to the Treasury which may have accrued. In his brief tenure as Scottish Tory leader, Jackson Carlaw indicated that he would abolish it, although as far as I can see this pledge did not make it into Douglas Ross’s manifesto for last May’s election.

In its 73-page, closely reasoned judgment the Supreme Court cited no evidence in support of the proposition that the policy has encouraged poorer families to stop at two children. How could it, when so many other aspects of the UK’s welfare state continue to support families no matter how large they grow? There is no two-child limit on child benefit, nor on housing benefit, nor on assistance with childcare costs, nor on free school meals. As the Supreme Court put it, “none of these benefits is subject to any limitation relating to the number of children”.

But even if there were such evidence, the policy would still not have been ruled unlawful. As the court noted, “it is an ordinary fact of life that couples take decisions about the size of their families in the knowledge that their income will not automatically increase as the number of their children increases”.

Neither human rights law nor any other legal principle obliges the state “to alter that situation by ensuring that parents are provided with additional income for every additional child that they may choose to have”.

READ MORE: Neil Mackay: What was wrong with James Dornan saying Rees-Mogg would 'rot in hell'?

Quite so. The question of how the welfare state should support families is a (hotly contested) matter of political opinion, not an issue primarily for the courts. Why? Because it involves the expenditure of taxpayers’ money and, in a democracy, people who decide how to spend public money need to be accountable directly to the public whose money it is.

Courts, for long-standing reasons, are properly insulated from this direct accountability: indeed, it is a constitutional requirement that judges are independent of it. Their accountability comes through the obligation they are under always to give the fullest reasons for their decisions (hence the 73 pages).

All this is easy to say but rather harder to achieve. Courts across the world wrestle with how far they should allow the law to intervene in matters of political controversy. The US Supreme Court’s world-famous decisions on abortion and the death penalty are only the most notorious examples. In very recent years our Supreme Court has attracted outspoken criticism for becoming too interventionist – too political. Last week’s decision on the two-child cap contains welcome signals that the justices recognise they need to tread carefully and not trespass into areas that are properly for government and parliament.

READ MORE: Pensions: Intergenerational fairness begins by unpicking the Triple Lock

The case was brought by the Child Poverty Action Group. CPAG had been heavily involved in the law-making process in Westminster that led to the two-child cap being imposed in the first place. Indeed, CPAG provided a whopping 283 pages of evidence to MPs as to why the policy should not be introduced. They lost that argument in Parliament and the Supreme Court was both wise and prudent not to allow itself to be used as a back door for campaigning groups who had already failed at the front.

The court cited an old dictum: “the democratic process is liable to be subverted if, on a question of moral or political judgment, opponents of [legislation] achieve through the courts what they could not achieve in Parliament”.

Those who oppose the two-child cap on the availability of child tax credits should not litigate; they should legislate. That applies to the SNP every bit as much as it applies to the Child Poverty Action Group.

Our columns are a platform for writers to express their opinions. They do not necessarily represent the views of The Herald.