He was just going to pass through it. I think he was visiting some country in Central America or returning from central America. Rather than take an airplane he and his friend decided to pass through.
I feel bad for him, but why try to take in a weapon in the first place? He took out the proper paperwork and the weapon was pulled apart. The problem was that the barrel was a few centimeters too short other than what was written about in the paperwork or the allowed in Mexican law. It was a stupid technicality and pure IDIOCY on Mexico's part. They very well could have told him at the border before he crossed that the weapon was not allowed to enter the country. That would have been the best way to deal with it, rather than put him in prison since August.
I don't agree that he should have traveled with a weapon at all, to ANY country. There was no reason for him to do it, other than he had PTSD and the weapon (being his grandfather's heirloom) brought him comfort.