I don't think most people think of cases like this when they say "I'll uphold the law" seeing it more as a generic thing like software Terms of Service, or doesn't cover people who say that at first thinking in the abstract but then get a conscience attack when they find out what the case is actually about.
Then there's also cases where the law is badly worded or is outdated in intent and can end up with some types of prosecutions that most people would find horrendous. For example I read about how in Michigan, the state had a law making it a felony to gain "unauthorized access to a computer network", a law that was obviously aimed at computer hacking and the like, but was several decades old and written so vaguely that it actually covered accessing someone else's non-password protected wi-fi network without the owner's permission, and thus not only prohibited that but made it a felony. A felony for piggybacking on wi-fi is not what most people would see as "upholding the law" since it's clearly not what the law was written about.
Another example I heard about thanks to Ingress is Tennessee's statute regarding cemeteries:
Sounds like a pretty standard law aimed a preventing cemetery desecration or trespassing. However note the "play at any game or amusement" bit. This means that any person who plays Ingress in a cemetery in Tennessee, even if all they do is walk in, claim a portal on their phone silently and walk out (or hell even if they happened to claim a portal while they were visiting a grave) or kids playing hide and go seek in a cemetery are guilty of felonies in Tennessee. I think most people would find this a bit draconian, regardless of what your opinion of playing Ingress in cemeteries is (and it's not in any way dispruptive, it's about equivalent to someone walking into a cemetery and sending a text message. Playing Ingress looks like texting.)
Then there's
this example.
Now while such laws are quite common, most states have safeguards to prevent this sort of thing from happening, such as putting up warning signs in all stores that sell cold medicine (this is the case in Minnesota) or requiring ID or tracking such purchases made on a credit card and not allowing further purchases if someone hits the limit. Indiana doesn't do any of this. So it's quite clear the Indiana law is quite poorly designed, and victimized a woman completely innocent of what it's targeting.
And then there's this:
http://reason.com/archives/2007/11/01/persecuted-pillsA man was tried for possessing drugs he had a prescription for, with the prosecutor outright saying "there is no prescription defense" under Florida law. Seriously. Now even if that's technically true, then it means the Florida law is idiotic, badly written and it does no one any favors to uphold it.