The Court also held that the Supremacy Clause (Article VI, Clause 2), which elevates federal law above state law when the two are in conflict (and do not involve a right explicitly reserved to the states) protected the bank from being taxed by the State(s).
The Supreme Court determined Congress had the right to establish a (federal) National Bank under the principle of implied powers. (also called unenumerated powers) Specifically, Chief Justice Marshall held the Taxing and Spending Clause (Article I, Section 8, Clause 1) and Necessary and Proper Clause (Article I, Section 8, Clause 18), allowed Congress to charter a national bank as an appropriate action supporting legitimate federal interests:
"To make all laws which shall be necessary and proper for carrying into execution the foregoing powers, and all other powers vested by this Constitution in the government of the United States, or in any department or officer thereof."
In the opinion of the Court, Marshall concluded that Congress had the right to establish a national bank as an implied power under the Necessary and Proper Clause because the bank was being used to further Congress' constitutional authority to tax and distribute funds. Unlike the Articles of Confederation, which preceded the US Constitution, the Constitution does not prohibit the exercise of implied powers necessary to assist in carrying out constitutional mandates.
McCulloch v. Maryland, 17 US 316 (1819)