Yeah this is really ridiculous. If the tech didn't actually do any work and is lying about it, then that's messed up, but more than likely, he took out the stock midpipe, put the new one in, trie to finagle it into position, and took it out. They should have called you and kept you informed, but it was also well within their right to get you arrested. You walked out on a bill, and they react to that the same as any other business. Wether the charge was moral or whatever is not up to you to decide.
You signed a work release for them to perform labor on your car with the intention of installing a midpipe. They didn't get it installed because it didn't fit, but they still performed the labor that you agreed to pay for. I wouldn't have wanted to pay for it either, but you signed a contract saying you would pay for it, then you walked out on the bill, which is illegal, any way you look at it.