Just to emphasize your point: the judge in this case is not trying to let the accused off the hook: he/she is pointing out a hole in Massachusetts law.
I'm totally not a lawyer, but I live in Massachusetts and spent some time reading the law today so that makes me an expert. As far as I can tell, upskirt doesn't fall within any of the following Mass sexual crimes:
Rape: Rape in Mass requires penetration.
Indecent assault and battery: Requires physical contact.
Sexual harassment: is specific to the workplace.
Peeping tom: requires that the victim be partly undressed.
Criminal harassment: must be repeated on three occasions.
Unnatural and lascivious acts: applies to sexual acts in public.
It really does seem to me that as far as criminal law goes, upskirting really does fall between the cracks of Massachusetts law.