The Supreme Court ruled 8 to 0 yesterday that a state can't bar a person from public office simply because he is a clergyman.

The ruling struck down a 182-year-old provision of the Tennessee constitution - the last of its kind in the nation - barring clerics as legislators lest they be diverted from their dedication "to God and the care of souls."

In 1976, the legislature relied on that provision to pass a law barring clerics from serving as delegates to last year's state constitutional convention.

The law produced a challenge to the candidancy of the Rev. Paul A. McDaniel of Chattanooga, a Baptist minister.

A lower court ruled for him, and he was elected. But Tennessee's highest court upset the judgment, finding the law a barrier to the "establishment of religion" prohibited by the First Amendment to the U.S. Constitution.

In reversing the Tennessee court, all of the Supreme Court justices agreed that the provision and the law violated the U.S. Constitution. But they produced four separate opinions about what violation was.

Chief Justice Warren E. Burger found an infringement of the "free exercise" of religion guaranteed by the First Amendment. Justices Lewis F. Powell Jr., William H. Rehnquist and John Paul Stevens joined his opinion.

Justice William J. Brennan jr. said that in addition, the provision violates the amendment's ban of laws "repecting an establishment of religion" because it deprives clergymen of "the full measure of protection afforded speech, association and political activity generally." Justice Thurgood Marshall joined Brennan's opinion.

Justice Potter Stewart, agreeing with Brennan, said that the provision was invalid under a 1961 Supreme Court decision that Maryland denied freedom of religion when it refused to commission, as a notary public, a man who would not declare his belief in God.

Finally, Justice Byron R. White, unpersuaded that Tennessee, "in any way," had interfered "with McDaniel's ability to practice his religion as he wishes," said that the state had denied him the equal protection of the laws.

The Tennessee constitutional provision is rooted in English and early American history. In 1783, Thomas Jefferson, over the strong opposition of James Madison, put a similar provision in his draft of a constitution for Virginia. In 1800 Jefferson reversed himself.

Among 13 states that disqualifed clergy from some types of public office, only Maryland and Tennessee continued the practice into 20th century. In 1974, a panel of three federal judges invalidated the Maryland provision. The state did not appeal.

Justice Harry A. Blackmun, who was ill when the Tennessee case was argued, did not participate in it.