They really don't have a choice, they have to uphold the law as it is written.
They do, indeed. However, the "written law" includes the sixth amendment to the constitution, guaranteeing the accused the right to a jury of their peers. Peers. The purpose of that right is to ensure that We The People are the ones determining if a person should be punished for a particular action. Not a government agent, or legal professional.
The flip side of the 6th amendment guarantee to the accused is that the juror owes that duty to the accused, and the juror is constitutionally empowered to reach a decision.
Constitutional powers supersede legislated law. The juror is not beholden to legislated law. Indeed, if they feel that strictly applying a lower law results in an injustice, they have a constitutionally-imposed duty to reject the short-sighted legislated law.