So Kevin Andrews has, as many lawyers expected, egg on his face today with Federal Court Judge Jeffrey Spender ruling less than an hour ago that Mr Andrews was wrong to cancel Gold Coast doctor Mohammed Haneef’s visa last month.

When Mr Andrews made his decision, after a Brisbane Magistrate released Dr Haneef on bail, the Chairman of the Australian Bar Association Stephen Estcourt QC summed up the views of the vast majority of the legal fraternity when he dubbed Mr Andrews’ actions “a threat to the rule of law” and nothing more “than a cynical use of power.”

He was right and Justice Spender’s decision proves the point. According to Justice Spender Mr Andrews applied the wrong test in determining that Dr Haneef should be thrown out of the Australia.

Mr Andrews justified his decision on the basis that he had a reasonable suspicion that Dr Haneef had associated with terrorists and therefore failed the test of good character that a person must pass to keep a visa. But Justice Spender blew this line of argument out of the water:

I reject the submission by the Solicitor-General for the Minister that the “character test” which a person does not pass if the person has or has had an association with a person or group or organization that the Minister reasonably suspects has been or is involved in criminal conduct, does not involve any question about the character of the person.

In my opinion 501(6)(b) is a composite phrase and has to be construed as such. In my opinion it has the connotation that there is an alliance or link or combination between the visa holder with the persons engaged in criminal activity. That alliance, link, or combination reflects adversely on the character of the visa holder. Such a meaning would exclude professional relationships, or those which are merely social or familial. It would exclude the victim of domestic violence.

And Justice Spender was critical, or at least quizzical, of the way Mr Andrews sought to justify his decision to the media by releasing only part of the second record of interview with Dr Haneef to show that he had grounds to kick him out:

There is, nonetheless, a certain piquancy in the present case, in that the Minister has chosen to give a selected part of what is said to be protected information to the public by way of press release, but has not sought to divulge to the Court any part of the protected information under s 503A(3) of the Act .

The Minister is, in a sense, presenting one case in the public arena, a case the accuracy of which cannot be challenged in any meaningful way, and a smaller and not the same case in the Court, in a way which does not permit explanation or challenge by way of cross-examination.

No doubt Mr Andrews will examine appealing this decision to the Full Court of the Federal Court, but for the moment his credibility as a minister who understands how to properly administer Australia’s migration laws has taken a battering.

Earlier this month Mr Andrews said he had no regrets over his handling of the Haneef matter. One wonders whether, when he reads Justice Spender’s decision, he might change his mind. He ought to.