The original Bill of Rights was considered to apply only to the federal government. This was codified in Barron v. Baltimore (1833 - no religious angle although coincidentally from Maryland), but it was generally understood from the beginning. This is actually most explicit in the First Amendment, which begins "Congress shall make no law," but it was understood to apply to the entire Bill of Rights. Beginning in the 1920s and really accelerating in the 1960s, one by one the Supreme Court applied the Bill of Rights principles to the states, using the "no person shall be deprived of life, liberty, or property without due process of law" clause in the Fourteenth Amendment (which is an amendment that regulates the states).
The Maryland law to which you refer applied not to voting but to office holding. The Constitution (as adopted in 1787, even before the Bill of Rights) bans religious tests at the federal government level, but at the time most states had some form of test limiting office holding to theists, more narrowly to Christians, or more narrowly still to Protestants. One by one these were generally eliminated in the Early Republic period. The Maryland law was a Christian test, and the law that repealed it was bluntly referred to as "the Jew bill." (Jews were a mostly but not completely theoretical group in 1820s Maryland.) Strongly restrictive tests in North Carolina (Protestant test to 1835, Christian test to 1868), New Jersey (Protestant test to 1844), and New Hampshire (Protestant test all the way to 1877) lasted longer than the Maryland test. And a number of states, including Maryland, retained theist tests into the twentieth century. It was a Maryland case, Torcaso v. Watkins, that brought these to an end in 1961, under the then-newish application of the Bill of Rights to the states. (Torcaso only wanted to be a notary public, but even that was covered by the test. There certainly was, and mostly still is, a taboo on electing professed atheists to the legislature, which is probably why no one challenged the test earlier.)
Source: James Kabala, Church-State Relations in the Early American Republic, 1787–1846 (Routledge).