Thompson said that previous court rulings have allowed displays on government property if they have a secular purpose and do not foster "excessive government entanglement with religion." He said the Ten Commandments monument fails this test.
"His fundamental, if not sole, purpose in displaying the monument was non-secular; and the monument's primary effect advances religion," Thompson said.
Moore testified during the trial that the commandments are the moral foundation of American law. He said the monument acknowledges God, but does not force anyone to follow his conservative Christian religious beliefs.
A lawsuit seeking removal of the monument argued that it promoted the judge's faith in violation of the constitution's ban on government establishment of religion.
Moore installed the monument after the building closed on the night of July 31, 2001, without telling any other justices.
"This monument was snuck in during the middle of the night and they can sneak it out just as easily. It's a gross violation of the rights of the citizens of Alabama," said Morris Dees, lead counsel and co-founder of the Southern Poverty Law Center, who urged Moore to remove the monument immediately.
The monument, which features the King James Bible version of the Ten Commandments sitting on top of a granite block, is one of the first things visitors see upon entering the building.
In his ruling, Thompson said he found the monument to be more than just a display of the Ten Commandments and other historical quotations.
"The court is impressed that the monument and its immediate surroundings are, in essence, a consecrated place, a religious sanctuary, within the walls of the courthouse," Thompson wrote.
An appeal was expected. Neither Moore nor his lead attorney, Stephen Melchior, had any immediate comment on the ruling. An assistant to Melchior said they were reserving comment until they had read the opinion.
Moore fought to display a wooden plaque of the commandments on his courtroom wall in Etowah County, before he won election as chief justice in November 2000.
``The basic issue is whether we will still be able to acknowledge God under the First Amendment, or whether we will not be able to acknowledge God,'' Moore testified.
Rev. Barry W. Lynn, executive director of Americans United for Separation of Church and State, called the ruling a setback for ``Moore's religious crusade.''
``It's high time Moore learned that the source of U.S. law is the constitution and not the Bible,'' Lynn said.
One of Moore's supporters, Alabama Christian Coalition President John Giles, said he believes there may be a backlash against the ruling in Alabama, a Bible Belt state in which Moore won easily two years ago.