Sometimes defending the First Amendment involves standing up for miscreants, no matter how distasteful.

And passing yourself off as a war hero, as some have done in recent years, is about as low as you can go. Yet lying isn’t illegal, and Americans who lie about receiving military honors are protected by the Constitution.

That’s why we opposed the Stolen Valor Act, sponsored by then-Congressman John Salazar of Colorado, and that’s why a federal appeals court this past week upheld a ruling that determined the law, which makes it illegal to lie about receiving military honors, violates free speech.

A free-speech exception for lying would gut the First Amendment. As 9th Circuit Court of Appeals Judge Alex Kozinski wrote, “Saints may always tell the truth, but for mortals living means lying.”

“If false factual statements are unprotected, then the government can prosecute not only the man who tells tall tales of winning the Congressional Medal of Honor, but also . . . the dentist who assures you it won’t hurt a bit.”

The case that was upheld last week involved a California man who pleaded guilty in July 2008 to falsely saying the year before that he had won the Medal of Honor. In Colorado, Rick Strandlof pretended to be a former Marine captain who had won a Purple Heart and a Silver Star, and was convicted under the law.

But last summer a Colorado-based federal court judge decided, and rightly so, that prosecuting Strandlof under the law was an unconstitutional restriction of free speech. It’s important to note Strandlof didn’t financially benefit from the lies. Had he, he could have — and should have — been charged with fraud.

The truly sad part of this, we acknowledge, is that free speech has never been free. It has been achieved by the spilled blood of war heroes — the same people these scoundrels are impersonating.