In reasons released in support of rulings he made last week, Judge Edmond Blanchard found the government and Canada's spy service made several mistakes over the 13 years Mohamed Mahjoub has been jailed or under house arrest.
Nevertheless, Blanchard ruled, those errors did not warrant stopping the proceedings.
"There is simply no conspicuous evidence of improper motives, bad faith or an act so wrong that it violates the conscience of the community such that it would be genuinely unfair and indecent to proceed," Blanchard wrote.
Mahjoub's lawyers were not immediately available to comment.
Last week, Blanchard dismissed several motions by Mahjoub, who is fighting a national security certificate that allows for indefinite detention without charge or trial.
The judge delayed making his reasons public until Wednesday to allow time to vet them for security concerns.
Mahjoub, 53, a father of three from Toronto, has been living under a cloud since his first arrest in 2000.
Based on secret evidence which was in part supplied by foreign agencies linked to torture, the government alleges Mahjoub was a senior member of an Egyptian terrorist group.
Mahjoub denies any terrorist links and has staved off deportation because of the risk he would be tortured in Egypt.
Blanchard said the courts had already addressed one of Mahjoub's key concerns: that the evidence collected by the spy service was tainted by torture.
Some of that evidence had already been excluded, the judge said, adding the service did not act "intentionally or recklessly so as to undermine the integrity of the court or public confidence in the administration of justice."
The judge also blamed Mahjoub in part for the years his case has taken.
"To a large extent the length of the process was due to its inherent complexity and Mr. Mahjoub fully exercising his procedural rights," the court said in a summary of Blanchard's reasons.
At the same time, the government did delay matters unreasonably by illegally taking Mahjoub's defence documents from a courtroom but the court remedied the breach by removing 11 members of its legal team from the case, Blanchard said.
The judge rejected Mahjoub's complaint that the Canadian Security Intelligence Service destroyed original records of wiretaps, leaving only summaries, although he did agree this violated his right to disclosure.
"The services actions were carried out in good faith and do not so taint the proceedings as to warrant the remedy of a stay," Blanchard said.
According to the judge, security agents did not have to inform Mahjoub of his right to remain silent or to a lawyer because he was not detained at the time, and because he voluntarily invited them into his home to answer their questions.
While the government had illegally listened in on his conversations with his lawyers, any prejudice to Mahjoub was "negligible."
Reasons that support other parts of Blanchard's decision — including why the security certificate is reasonable — have yet to be made public pending vetting for security concerns.