Actually, it was a combination of "Heller didn't say that" and "you can't use Heller like that.
The Massachusetts Court used three arguments to uphole the ban on stun guns. First, they said the Second Amendment didn't cover the stun gun because it was not in existence at the time of ratification. An argument Scalia, in Heller, said "bordered on the frivolous."
Then the court tried to say the stun gun was "unusual" because it was a thoroughly modern technology. Finally, they said that the stun gun had no military purpose and therefore wasn't protected, which is sorta what Miller said in 1939. All that ridiculousness aside, SCOTUS in an 8-0 per curium decision said:
i can agree with a majority of your reading of the case, but i think it is a little misleading for you to mention the per curiam decision in the way that you did. if your post was designed to infer that an outright ban on stun guns is unconstitutional, then you may have misread the case, no offense though.
scotus did not touch on the issue of whether an outright ban on stun guns is unconstitutional. rather, they basically said, "dear MA supreme court, you're more than welcome to find the stun-gun-ban law constitutional, but make sure that you apply the right test in doing so, and make sure that you apply reasoning that doesn't conflict with the law that we already decided."
i suspect that there are two reasons why there was a per curiam opinion, but i can guarantee you that it was NOT because scotus believes that stun guns should be available for ownership in all states.
first, i suspect that there were no justices that would have wanted to put their name on this opinion. since the entire case seemed to rely on an improper analysis of the "unusual" prong, the entire scotus bench could easily jump onto an order that vacates the decision and remands the case back to MA for a do-over. i think it would have been a very different case had the MA court also reached the "dangerous" prong. my reasoning to support this is the concurrence by Alito. if Alito had a more popular opinion among his colleagues with respect to this issue, then CJ probably would have appointed him to write the opinion. however, in this case, there weren't many that jumped onto Alito's logic, save for the usual suspect (Thomas).
second, i suspect that it was a mix of the justices being lazy and also not wanting to settle a 2nd amendment issue without a full bench. in some sense, the court has been dodging 2A issues for quite some time, namely the proper level of scrutiny to apply in these cases. in that absence of a definitive ruling, the circuit courts have been applying all kinds of levels with no consistency.
regardless, the one good thing to come out of the caetano case is the reaffirmation of the principle that, "the Second Amendment extends, prima facie, to all instruments that constitute bearable arms, even those that were not in existence at the time of the founding, and that this Second Amendment right is fully applicable to the States." although that was originally raised and decided in the mcdonald case, it was shaky precedent at best since the justices were all over the table on that one--with some concurring in the opinion, some concurring only in judgment, and some outright dissenting. at least this time around scotus seems to be "sticking to their guns," both literally and figuratively.