Does it make sense that a person can burn an American flag with impunity but not a gay-pride flag? Earlier this month, a judge in Story County, Iowa, sentenced Adolfo Martinez to a preposterous 16 years in prison for swiping the rainbow flag from a nearby church and burning it in front of a strip club.

Mr. Martinez, 30, has a long criminal history, which partly explains the long sentence. He had two felony convictions, and Iowa law deems any three-time felon an “habitual offender,” subject to enhanced sentencing. But a jury...