The country’s top judges unanimously ruled that a woman is defined by biological sex under equalities law in a case brought against the Scottish Government by the group For Women Scotland.
John Swinney said that he fully accepted the court’s judgement but also recognised the pain it has caused.
Speaking while campaigning for the SNP’s candidate in the Hamilton, Larkhall and Stonehouse by-election, the SNP leader said the verdict must be followed.
He told the PA news agency: “Now, of course, there will be many, many people who feel very hurt by the decision that’s been taken by the Supreme Court.
“I understand that hurt and that anguish, and in my reaction to the Supreme Court judgement I’ve said two things: Firstly, that I accept the judgement of the Supreme Court because I believe in the rule of law, but secondly that I believe in the protection of the rights of everybody within our society.
“The Supreme Court made it abundantly clear that it was vital that the existing legal instruments that are in place to protect the rights of trans people continue to operate.”
Judge Lord Hodge said that the ruling should not be seen as a triumph for either side of the debate and stressed that existing law still gives trans people protection against discrimination.
Meanwhile, the Equality and Human Rights Commission (EHRC) announced it would be meeting with Health Secretary Neil Gray next week as the Government is urged to issue fresh guidance to public bodies on single sex spaces.
It comes amid a tribunal at NHS Fife involving nurse Sandie Peggie who objected to sharing a changing room with a trans doctor.
The EHRC has warned health boards they will be pursued if they do not adhere to the law on single sex spaces.
The Scottish Tories attacked Scotland’s equalities minister last month after she told a Holyrood committee she could not “say for a fact” that every hospital was following those rules.
Asked on Saturday by PA whether he could make that promise, Mr Swinney said: “It’s important that at all times we act within the law, and the guidance the Scottish Government has made available and that boards have had to operate within has been guidance essentially generated by the Equalities and Human Rights Commission.
“So, obviously, in the light of the Supreme Court judgement, there will have to be a good deal of dialogue and consideration around these issues, and that will be the subject of a statement to Parliament on Tuesday.”
Pressed again whether he could make that commitment, he added: “Obviously, it’s important that the law is followed in all circumstances, and I want to make sure that’s the case.”