It’s no laughing matter when the best-laid plans go awry, particularly for professional sports leagues, teams and players.

Even a well-oiled machine like the NBA (and its overrated commissioner David Stern) was humiliated two years ago when a “rogue” referee was called on the carpet for gambling — in effect, fixing the very games that he officiated.

On July 4 of all days, Americans discovered former NFL quarterback Steve McNair was a player in every sense of the word: Investigators delving into McNair’s recent death learned he was having an affair with a 20-year-old woman.

Copious questions have emerged, not unlike penalty flags in a Raiders-Chargers game: Is it true last Saturday’s tragic event was a murder-suicide, instigated by the mistress?

Was McNair unhappily married and separating from his wife?

Did Mrs. McNair know or even care about her late husband’s transgressions?

Such speculation doesn’t amount to a hill of beans in the long shadow of the man’s death.

The ex-quarterback’s case boils down to another respected public figure evidently trying to carry out a dubious double-life.

But more often than not these days, athletes such as McNair are getting exposed for their shady behavior.

Baseball’s extraordinary pitcher Roger Clemens has been accused of taking steroids.

More recently, Manny Ramirez was suspended (caught dead to right, if you will) for the same wrongdoing.

Hockey’s Rick Tocchet — not to mention scoring legend Wayne Gretzky’s wife — was implicated in a gambling ring. Tocchet was dealt two years probation for his alleged malefactions.

Footballer Adam “Pacman” Jones’s off-field mistakes couldn’t be counted on two hands.

And you needn’t be a sports fan to remember quarterback Michael Vick’s ongoing saga involving dogfights.

What was the millionaire signal-caller thinking?

Was he thinking at all?

Vick, of course, was rightfully imprisoned and now awaits his NFL fate.

Most, if not all, of those mindboggling tales — which wouldn’t seem amiss in a fictional narrative — pale in comparison to McNair’s tragedy.

Culture critic and author Chuck Klosterman, in his brilliant book “Killing Yourself to Live,” pointed out “Living is dying, little by little.”

But Steve McNair, at 36, seemingly had time on his side and — as a business owner — was still full of life.

As is often the case when a popular and famous figure meets an untimely death (Michael Jackson, anyone?), folks near and far chime in with feelings of “shock” and “sadness” while extolling said celebrity’s virtues.

Pundits have yet to stop praising the King of Pop, let alone mute his array of hit singles.

Despite an ugly litany of allegations, Jackson was never convicted or incarcerated — only publicly ridiculed, which is considered by some an equal fate.

Don’t think for a minute those molestation charges didn’t mentally drain Jackson.

It’s certainly no coincidence the singer all but went underground, residing in Bahrain while practicing his Islamic faith for a good chunk of time.

There was no public mockery of McNair, whose dirty little secret (harboring a lover who hadn’t yet seen the age of 21) was widely unknown — and thus undisclosed — until he stopped breathing.

Up until his death, McNair the quarterback was heralded as tough, talented and determined between the lines.

McNair the person, meanwhile, was known as generous, sincere and friendly, with a smile that lit up the room.

He has been recalled as a stand-up guy who wouldn’t hurt a fly — which makes his extra-marital shenanigans with a smitten 20-year-old all the more disturbing.

McNair, like too many sports personalities and celebrities, proved true the “only human” cliche.

As Danny DeVito rhetorically asked Gene Hackman in the movie “Heist”: “Which of us is perfect?”

Nobody, of course, but that doesn’t make it any easier to watch our heroes fall from grace.

Reach Jim Luksic at jluksic@syvjournal.com.