McCulloch v. Maryland did not establish the principle of states not being able to spend more than they could raise in a year, but there was no such restriction on the federal government. The main issue of McCulloch v. Maryland was that the state of Maryland was attempting to tax bills not created in Maryland that came from any bank headquartered outside of Maryland.
However, the issue was that there was only one bank outside of Maryland at that time: the Second Bank of the United States. In a nutshell, the case came to court because the Second Bank felt that the law was specifically targeting them, even though the law was meant to target every bank outside of Maryland.