Several years ago I saw an old Rockford Files rerun on TV. In this episode, an old guy got out of prison and was bragging about the crime he had committed. He figured he was OK because the statute of limitations had run out. He hires Rockford to help him find the loot he had stolen. They were unsuccessful. In the last scene of the show, the IRS knocks at his front door and announces that the $200,000 he had stolen was subject to income taxes plus penalties plus interest. Before they fade to black we see the ashen, anguished face of the criminal as he faces a fresh nightmare.

When the tax code was first written back in 1913, the phrase “income from all lawful sources will be subject to an income tax” was put into the body of the code, essentially letting off all criminals from incurring a tax liability. The smirking didn’t go on for too long--the code was immediately changed to include income from ill-gotten gains.

Last week I covered why growers and distributors of medical marijuana must report income. Pending legislation is set to allow cost of goods sold expenses against it. The tax court has dealt with many different types of criminal activities—here’s a look at how it ruled:

Embezzlement is an illegal activity. In Woods v. Comm’r; T.C. Memo, 2011-190, an embezzler sought to avoid income tax on stolen funds by claiming that the funds were diverted to his grocery store corporation and therefore it was the corporation, not he, that received the income. I guess he was looking for that favorable corporate tax rate. Well, he lost.

In another embezzlement case, JAMES V. UNITED STATES, 366 U. S. 213 (1961), James claimed that embezzled funds were not income because they were required to be repaid. The court ruled against him and he served three years in prison.

My favorite story qualifies for “The Stupidest Tax Story of the Year Award.” A business owner hired an arsonist to burn down his store for the insurance money. He sent him a 1099 at year end for his services. A couple of years later when he was audited, the auditor looked at the 1099 and asked what services were rendered. The business owner told the truth—but it did not set him free. They cuffed him and carried him away. Not for a tax-related crime, but for insurance fraud.

Note that as business owners, probably all of us have all been guilty of illegal activities. Your eyebrows shoot up at that one, don’t they? But consider this: A speeding ticket is an illegal activity. So is a parking violation. And in fact, neither of those is deductible as a business expense. It doesn’t matter that you sped into town, earning the speeding ticket then parked illegally to just barely make it in time for the biggest business meeting of the year. You can’t write off those tickets.

And if you are brazen enough to pay bribes, kickbacks and rebates to consummate a business deal, those expenses are not deductible either. In fact, any payment made to an official or employee of any government is not a write off.

But check this out: Embezzlers, thieves and the like have been allowed to take deductions for costs relating to criminal activities. In Commissioner v. Tellier, a taxpayer was found guilty of engaging in business activities that violated the Securities Act of 1933. So what did he do? He wrote off the legal fees he paid to defend himself. The tax court allowed it because they meet the requirements of IRS Code §162(a), which allows the taxpayer to deduct all the “ordinary and necessary expenses paid or incurred during the taxable year in carrying on a trade or business.” The Tellier court reiterated that the purpose of the tax code was to tax net income, not punish unlawful behavior.

Bonnie Lee is an Enrolled Agent admitted to practice and representing taxpayers in all fifty states at all levels within the Internal Revenue Service. She is the owner of Taxpertise in Sonoma, CA and the author of Entrepreneur Press book, “Taxpertise, The Complete Book of Dirty Little Secrets and Hidden Deductions for Small Business that the IRS Doesn't Want You to Know.” Follow Bonnie Lee on Twitter at BLTaxpertise and at Facebook

Bonnie Lee is an enrolled agent admitted to practice and representing taxpayers in all 50 states at all levels within the Internal Revenue Service. She is the owner of Taxpertise in Sonoma, Calif., and the author of Entrepreneur Press book, “Taxpertise, The Complete Book of Dirty Little Secrets and Hidden Deductions for Small Business that the IRS Doesn't Want You to Know.” Her new e-book Taxpertise for the Creative Mind Murder, Mayem, Romance, Comedy and Tax Tips for Artists of all Kinds is available at all major booksellers. Follow Bonnie Lee on Twitter and on Facebook.