Mr Justice McCloskey dismissed Bobby Fitzsimmons' claim to having been wrongly held by detectives hunting Mr McCartney's killers.
He said: "I consider that the police were duty bound to arrest this plaintiff and to detain him for the period under scrutiny."
Mr Fitzsimmons sued the Chief Constable for his alleged unlawful arrest and false imprisonment months after Mr McCartney, 33, was stabbed to death outside a central Belfast bar in January 2005.
The victim, a father-of-two from the Short Strand area of the city, is believed to have been in an argument with republicans before he was attacked.
A second man, Brendan Devine, was also stabbed and badly wounded in the same incident.
The killing attracted worldwide attention and put Sinn Féin under huge pressure at the time.
Although no one has been convicted of Mr McCartney's murder, his five sisters and partner waged a major campaign to bring those responsible to justice.
Mr Fitzsimmons was arrested twice as part of the investigation into events surrounding the killing. On both occasions he was released without charge.
He sought compensation from the PSNI over being held for nearly 34 hours the second time in October 2005.
Giving evidence to the court he insisted he was an innocent man who should not have been detained.
There is no hint of any misuse of powers or other legally improper motive on the part of the police officers concerned.
Mr Justice McCloskey
But the arresting officer testified to having been briefed that Mr Fitzsimmons was suspected of conspiracy to murder Robert McCartney and Brendan Devine, possession of an offensive weapon, and causing an affray in the Market Street area.
A written police briefing disclosed in court stated that Mr Fitzsimmons and another man named only as XY were believed to have been "deeply involved in these serious offences".
Eye-witness accounts from Mr Devine and others at the scene supported this belief.
Further witness evidence placed both suspects in the bar involved in altercations with the victims, according to the briefing.
It added: "A witness accompanying Mr Devine corroborates his account of events at the initial stages of the altercation at the entrance to Market Street.
"This witness identified two other males as being present in Market Street at the time, namely XY and Robert Fitzsimmons.
"This witness further alleges that a number of these males were armed with sticks and bottles.
"Additional evidence available to the enquiry team included CCTV footage, telecommunication evidence, photographs, forensics and intelligence material.
Dealing with Mr Fitzsimmons first arrest in February 2005, after he voluntarily went to police with his solicitor, the judge said his evidence on his actions and refusal to answer questions "gives rise to an incongruity".
In a written statement the plaintiff then provided to the Police Ombudsman in May 2005 he admitted being in Magennis' Bar in the company of Mr McCartney and others on the night of the killing.
It described how a brief verbal and physical altercation between Mr Devine and another person inside the pub continued outside.
More fighting then ensued with two or three aggressors, but because it was dark Mr Fitzsimmons could not really make out what was happening, according to his statement.
He said he remained in the bar for a period, knowing nothing of the murder or attack on Mr Devine, before being driven with others to a club to continue drinking.
In his account he added: "I wish to state that I am not guilty of the murder of Robert McCartney or the attempted murder of Brendan Devine, nor am I guilty of affray."
Delivering judgment in the action, Mr Justice McCloskey held that his evidence about the circumstances surrounding the making of the statement were "unsatisfactory".
Turning to the October arrest at the centre of the claim, the judge said he was satisfied the arresting officer undoubtedly suspected the plaintiff had committed the conspiracy to murder, affray and possession of an offensive weapon offences.
He said: "The defendant's evidence has discharged the burden of justifying the plaintiff's detention for the whole of the period under scrutiny.
"There is no hint of any misuse of powers or other legally improper motive on the part of the police officers concerned."
Mr Justice McCloskey also stressed that his ruling was solely on the question of the lawfulness of Mr Fitzsimmons' arrest and detention.
He said: "It is appropriate to emphasise that this judgment does not speak to questions of guilt or innocence in relation to the dreadful murder of Robert McCartney on January 30, 2005 or any associated offence."