Since that has been previously addressed, I will deal with the actual reasons these decisions were bad law.
First, they are historically inaccurate. I am not really going to cover this here since that would be a whole post in and of itself. The bottom line of that one is that the Amendment relates to the distrust for a standing army and bloated military establishment. More than enough evidence for that in Anglo-American political history which is something that would have shown up if Scalia and Alito had bothered to have done their research.
Second, it removes the Second Amendment from the Constitutional Context and makes it a non-sequitur. Not enough attention is paid to the preamble of the US Constitution here. That is important since it gives a hint what the intent of the founders happened to be when they drafted the Constitution.
The founders make it clear that the Constitution is supposed to address matters of the common defence. No where in the constitution is the concept of self-defence or personal defence addressed. It is a well known legal principle that if a text is silent on something one cannot infer that it is addressed by the law.
Furthermore, Article I, Section 8, Clause 16 gives Congress, and Congress alone, the power to:
To provide for organizing, arming, and disciplining, the Militia, and for governing such Part of them as may be employed in the Service of the United States, reserving to the States respectively, the Appointment of the Officers, and the Authority of training the Militia according to the discipline prescribed by Congress;It was the power to arm the militia that concerned the founders given the distrust of standing armies. Again, there is Constitutional history here in that the Federal Government had a professional army, while the states had their militias. It was a fear that the militias would be frustrated by Congress not funding them.
Instead, the militias died from lack of interest. But I've covered that elsewhere as well.
Since the Second Amendment relates to Federal power under Article I, Section 8, Clause 16, it cannot apply to the States. That makes the McDonald decision a legal absurdity.
Third, The Heller decision acted as if it was a case of first impression, which it was not. That means the Heller and McDonald decisions were a violation of stare decisis.
While, Marbury v Madison did not relate to the Second Amendment, it did address Constitutional language and said that no clause in the Constitution was without meaning. Of course, given Marbury's significance, perhaps we can ignore these examples of poor judicial decisions (Heller and McDonald).
Which gets to the two 19th Century Second Amendment decisions: US v. Cruikshank, 92 U.S. 542 (1876) and Presser v. Illinois, 116 U.S. 252 (1886).
Cruikshank is short, but not really helpful because of that:
The right to bear arms is not granted by the Constitution; neither is it in any manner dependent upon that instrument for its existence. The Second Amendments means no more than that it shall not be infringed by Congress, and has no other effect than to restrict the powers of the National Government.It shows that the 19th Century lawyers were more aware of the relationship of the Second Amendment to Article I, Section 8, Clause 16. Which takes us to Presser. That is a decision I've mentioned before. It is one which is probably the best for deciphering US v. Miller, 307 U.S. 174 (1939). Presser addresses he "unorganised militia" argument, and it made clear that the Second Amendment related to only the organised militias, which is now the National Guard (see Perpich v. DOD, 496 U.S. 334 ).
Miller is problematic in that its style runs counter to how most people read judicial decisions. Its holding was most likely this paragraph:
In the absence of any evidence tending to show that possession or use of a "shotgun having a barrel of less than eighteen inches in length" at this time has some reasonable relationship to the preservation or efficiency of a well regulated militia, we cannot say that the Second Amendment guarantees the right to keep and bear such an instrument. Certainly it is not within judicial notice that this weapon is any part of the ordinary military equipment, or that its use could contribute to the common defense. Aymette v. State, 2 Humphreys (Tenn.) 154, 158.However it is unclear without the words "we hold" that this would be the holding, but it would logically be the holding. Secondly, the decision goes through the reasoning it came to this conclusion. The Miller decision then goes on to discuss Congress power to arm the militia. it then states that:
With obvious purpose to assure the continuation and render possible the effectiveness of such forces, the declaration and guarantee of the Second Amendment were made. It must be interpreted and applied with that end in view.That sentence directly contradicts the Heller and McDonald cases. That is because it makes clear that both clauses are necessary for interpretation of the Amendment. Even more importantly, it makes it clear that the Amendment only applies to the organised (active) militia.
Finally, since these decision would amend the constitution by neglecting an important part the text and change the meaning of the amendment. That would make the decisions ultra vires, or outside the power of the court. Unfortunately, the US Constitution does not provide for a cure for one of the branches acting outside their powers or failing to act.
So, that leaves us with bad law on the books. Fortunately, one doesn't have a problem with regulating firearms. In fact, I would suggest ignoring the two risible decisions and going toward strict regulation of firearms. After all, the two unconstitutional decisions only apply to a ban on handguns in the home. That means firearms regulation is wide open otherwise. And both Heller and McDonald made it clear that regulations were acceptable.
Which is why there hasn't been too much complaint about these decisions from the "anti-gunners".
 Aymette said: " To make this view of the case still more clear, we may remark, that the phrase, "bear arms," is used in the Kentucky constitution as well as in our own, and implies, as has already been suggested, their military use. The 28th section of our bill of rights provides, "that no citizen of this State shall be compelled to bear arms, provided he will pay in equivalent, to be ascertained by law." Here we know that the phrase has a military sense, and no other; and we must infer that it is used in the same sense in the 26th section, which secures to the citizen the right to bear arms. A man in the pursuit of deer, elk and buffaloes, might carry his rifle every day, for forty years, and, yet, it would never be said of him, that he had borne arms, much less could it be said, that a private citizen bears arms, because he has a dirk or pistol concealed under his clothes, or a spear in a cane. So that, with deference, we think the argument of the court in the case referred to, even upon the question it has debated, is defective and inconclusive."
 See Justice William O. Douglas’s dissent in Adams v. Williams, 407 U.S 143, 150 -51 (1972). Douglas was a member of the US Supreme Court when Miller was decided and glosses that case in the dissent.