UPDATE: Alan Gura, Attorney of Record for the Heller case, in the comments:
The facts are simple: the city bans guns.
If this were a “time place and manner” case, involving regulation rather than prohibition, it would have been an entirely different type of case. But it isn’t. The city claims guns are a social ill that should be prohibited. If there is a right to keep guns, the city’s policy preference is irrelevant.
Suppose the city abolished the exercise of religion, determining that religion poses an unacceptable challenge to the authority of the state, promotes sectarian strife, and is generally harmful because it undermines the public school’s educational mission with unscientific superstition. Such a law would be struck down as plainly inconsistent with the First Amendment, even if the government could establish to a judge’s satisfaction that religion has been known to have such deleterious effects, and that the legislature had a compelling need to address the risk.
And just imagine if trials were held to determine the current validity of constitutional provisions defining the structure or powers of government. We’re no longer the same society that initiated the income tax, or first elected a President every four years. Are those provisions suddenly subject to trial?
The Second Amendment is a duly ratified, operative part of the Constitution. People may disagree about how we should interpret the Second Amendment, but in our legal system, we do not have trials to determine whether it is desirable for portions of the Constitution to go into effect.