He was prosecuted for criminal conspiracy in an interstate crime. One end of that crime was Kansas. His physical location when he engaged in the conspiracy is immaterial.
> for doing something that wasn't against the law
criminal conspiracy is against the law. You can take almost any "legal" activity and make the doing of it an element of a crime. For example, saying "Yes" is not explicitly illegal. However, saying "yes" in answer to the question "Would you kill this guy for ten thousand dollars?" would be an element of the crime.
> as contracted by people whose plans he did not know
Except for the fact that he was selling them secret compartments, witnessed one stuffed full of almost a million dollars in cash, and continued doing business with them. Plus, "avoiding talk of illegality" indicates that he knew what service he was really providing.
> and he was convicted, and sentenced to twice the term of the actual lawbreakers
He engaged in a criminal conspiracy, so he was also an actual lawbreaker. His sentence was very harsh though, agreed, but he was knowingly engaging in a commercial enterprise that assisted criminals for a number of years.
> That's not how the rule of law works.
Yeah, actually it is. A judge and jury in this case looked at the overall pattern of facts and correctly determined that this guy was aiding people in breaking the law. That's how the law works.
Its unfortunate that a guy who clearly had developed some interesting skills and otherwise had a kind of messed-up life ended up where he got. But this is not the fault of the criminal justice system, or prosecutors gone wild. This is a guy who made some really stupid choices and got caught.