Joshua B. answered 03/03/21
Knowledgeable, Versatile, and Observant UNH History Tutor
The best answer I can give is based on Article VI of the Constitution and the First Amendment's Establishment Clause.
First, at the end of Article VI is the text "No religious Test shall ever be required as a Qualification to any Office or public Trust under the United States." So, no prohibiting members of a certain religion or the irreligious from holding office.
Secondly, the Establishment Clause reads, "Congress shall make no law respecting an establishment of religion or prohibiting the free exercise thereof." No favoring one religion over another, or of religion over no religion, in the law's eyes.
Take these two together, the short answer is that, while the nation is secular, there is no prohibition (at least as far as the state is concerned) on a religious leader holding office. The Supreme Court actually ruled in 1978 (McDaniel v. Paty) that state bans on clergy holding office violated the 1st and 14th Amendments.
The bigger concern today is whether or not this clause forbids taking religious views into account. Say, a devout Catholic President wants to nominate a devout Catholic for the Supreme Court over a Jewish or atheist candidate of equal merit.
As for what such a person should do, I don't know, but were I in that position, I would come out and say, "If good policy and my faith conflict, I will err on the side of good policy, even if I disagree. My religious views are mine, and I will not use them against another."
Further input is welcome.