No, this didn't happen, but Murray could be forgiven for misremembering an inaccurate story in the New York Times.
Murray is referring to the following NYT story:
Iran Exonerates Six Who Killed in Islam’s Name -- April 19, 2007
The Iranian Supreme Court has overturned the murder convictions of six members of a prestigious state militia who killed five people they considered “morally corrupt.” [...] Three lower court rulings found all the men guilty of murder. Their cases had been appealed to the Supreme Court, which overturned the guilty verdicts. [...]
According to the Supreme Court’s earlier decision, the killers [...] considered their victims morally corrupt and, according to Islamic teachings and Iran’s Islamic penal code, their blood could therefore be shed.
The last victims, for example, were a young couple engaged to be married who the killers claimed were walking together in public.
The final two paragraphs quoted here are both entirely false. I could say quite a bit about the betrayal of readers' trust involved in publishing these falsehoods, but I will stick to the facts.
First, the couple was already married, according to an RFE/RL article published a few days later.
The last two victims were Mohammad Reza Nejad-Malayeri and Shohreh Nikpur. The killers told the court that they were told that the two were corrupt and had "illegitimate relations," referring presumably to local hearsay about the couple, who were drowned in a pond.
"We did not know Shohreh and Mohammad Reza were married, and we thought they had illegitimate relations," the defendants said.
A Farsi language RFE/RL article confirms that the two were married. This is important to note because the Iranian Supreme Court was not, as NYT claimed, ruling that the killings were inherently justified due to "Islam." They were ruling that the killers' flimsy self-justifications needed to be considered by the lower courts, as we will see from what happened thereafter.
The English RFE/RL article also notes that one of the perpetrators was still in prison:
[...] A lawyer for the victims' relatives [...] said a "retaliatory execution" remained in force for one defendant, Ali
In fact what "exoneration" meant here was that the killers were being released on bail, except for Ali, who did not have bail money and was kept in prison. (source: 2013 article below)
Accordingly, the AP reported on the future direction of the trial:
The next step in the case will be a determination by the Supreme Court of whether the attackers were correct in their beliefs, Ahmadi reported.
This was the last of the trial reported on in the English language press, but it was neither the first nor the last trial held for the six defendants. These killings had happened in 2002 and the defendants were immediately sentenced. What the NYT was reporting on was actually the second time the Supreme Court of Iran had remanded the case to the lower courts to revise the justification for their sentencing. The case was then retried, with the bailed out defendants skipping court, and only Ali sitting in the defendants' box.
In 2012, after 10 years of remands and retrials, four of the six perpetrators were determined to have criminal culpability for the murders, and given a sentence: 10 to 15 years in prison, after which they would be killed if they had failed to appease the families of the murder victims, according to the Farsi edition of RFE/RL. This article also notes a pertinent fact: five of the six perpetrators (the five who had bail money) were members of prominent military families. In 2013, the prison/death verdict was approved by the Supreme Court and four perpetrators were arrested and sent to death row, which caused them much surprise and consternation, according to the article. A jurist interviewed in this article, via Google Translate, describes the role of the victims' parents as follows:
As far as I know, the parents will be invited to the head of the Supreme Court if they continue to demand retaliation, and after they have been given permission to execute the sentence, the sentence will be enforced against the convicted persons.
In May 2018, a settlement was reached between the families of the perpetrators and the families of the married couple, and the perpetrators were released from prison, according to a news story linked from Farsi Wikipedia's article on this incident.
It is not true that "the courts congratulated" the murderers for killing the couple, who were never accused of any crime and were in any case married. In Iran, like in other places (Philippines and Brazil come to mind), vigilante killing is not necessarily tried as murder in court. In this case, the lower courts pushed to have the killings treated as murder ipso facto, and the Supreme Court rejected this argument, saying they would need to consider how the killers had justified themselves. Eventually the killers' arguments were heard and rejected, and the majority of them were convicted of murder.
Furthermore, the couple was not killed "for holding hands" at all. They were not "shot at" by vigilantes who spotted them "walking together in public," but rather lured from their home under false pretenses, taken to a pond and drowned. The perpetrators claimed that they had heard rumors of the couple being unmarried and lascivious and selling alcohol, but the RFE/RA articles make this sound like a flimsy, callous excuse for a very straightforward lynching of two innocents whose main crime was being disliked by these privileged young men.
Murray and NYT have the facts of this case wrong, but on top of that, they give a false impression of public displays of affection in Iran. A survey conducted for a PhD thesis in 2005-6 found that almost 70% of unmarried female college students in Iran had held hands with the opposite sex, a practice that the researcher described as "very common and accepted."