I'd amend your statement to:
This notwithstanding, if you say you agreed with the law, and thought it had broken it, and agreed with how the law was being applied in this case, well, then, obviously you did the right (moral) thing.
After all, I would guess that most people don't have an objection to jaywalking laws in general -- but if an out of control car were hurtling towards you and you ran across a street to avoid it, I would hope that most people would think that charging you with jaywalking would be asinine.