I would think that would be a violation of Article VI of the Constitution:
“The Senators and Representatives before mentioned, and the Members of the several State Legislatures, and all executive and judicial Officers, both of the United States and of the several States, shall be bound by Oath or Affirmation, to support this Constitution; but no religious Test shall ever be required as a Qualification to any Office or public Trust under the United States.”
RE: but no religious Test shall ever be required as a Qualification to any Office or public Trust under the United States.
This is an interesting case because barring of atheists from holding public office is in the STATE constitution.
The problem is this — many of the state constitutions CAME FIRST before the US Constitution.
So, it becomes STATE CONSTITUTION vs The UNITED STATES Constitution.
There is no “religious test” specified by those states though, so that is how they got away with it. A religious test would be like what some colonies had before the Revolution, for example, only allowing Catholics or Anglicans to hold office.