Preventing Constitutional violations is not solely the province of the Legislative body; it is the purpose of the Judicial body. No law is necessary to protect a right that is ensconced in the Constitution; the Constitution is that law:
This Constitution, and the Laws of the United States which shall be made in Pursuance thereof; and all Treaties made, or which shall be made, under the authority of the United States, shall be the supreme Law of the land
The relevant concept is that of Judicial Review, and has been a cornerstone of American jurisprudence since nearly the beginning (in 1796, during the Jay court, and again in 1803 in the famous Marbury vs. Madison). Many Supreme Court cases depend on this; any time the Court strikes down a law, this is what they're doing.
Some civil rights are protected by the Constitution itself, or by its Amendments; the 14th amendment, for example, would prohibit a state from passing such a law as above. Congress has the power to enforce this prohibition, per the 5th section of the amendment:
Section 5. The Congress shall have power to enforce, by appropriate legislation, the provisions of this article.
But that's actually granting Congress that power (since the 10th amendment otherwise limits the power of Congress). Even if Congress does not exercise that power, nonetheless any state that passes a law contrary to this Amendment (or any other) would find that law subject to be struck down by the Courts under judicial review.
Of course, the actions of the Court are the actions of nine men and women, and it is certainly not guaranteed that they will act in a correct manner at any time; referring to the comment about the internment of Japanese citizens.
In the specific case noted - denying Muslims the right to hold office - this would be held up based on First Amendment rights as well as Fourteenth; Torcaso v Watkins supports that (which struck down a prohibition against atheists holding office, but the reasoning would be the same).
As far as mentally impaired individuals, many states do prohibit them from holding office. I wouldn't be surprised to find, in the (probably not near) future, that this is eventually struck down as well.