Lord Justice Millett, a Court of Appeal judge and himself a freemason, said the proposals set out by Jack Straw, the Home Secretary, were "completely wrong" and an invasion of privacy.
His attack comes as the United Grand Lodge of England is preparing to mount a public campaign against the Government's plans.
Mr Straw has said he intends to set up a public register of freemasons in the justice system, covering the police, the judiciary, the Crown Prosecution Service and the prisons and probation services. Declaration will initially be voluntary, although Mr Straw has warned that he will bring in legislation compelling registration if they do not co-operate with the system. New members who are freemasons will be required to register under their conditions of service.
Lord Justice Millett insisted there was no justification for such strongarm tactics by the Government. "I have no objection at all to voluntary disclosure. I object to the state requiring disclosure under compulsion of law. I think that is completely wrong. It is an invasion of privacy which should not be tolerated," he said.
He denied the freemasons were a secret society and said he had always been completely open about his membership. "It is a society with secrets in the sense there are little passwords, rather childish passwords, which we use during the ritual, but that's all," he told BBC Radio 4's Today programme.
"It is a completely harmless pastime. There is no difference between that and the membership of a golf club."
However Labour MP David Winnick, a member of the Commons Home Affairs Committee which has been investigating freemasonry, strongly defended the proposed register.
"Everything should be above board when justice is concerned and for the life of me I can't see why anyone should oppose declaring membership," he told the programme.