The answer to your question is fairly simple. More humor is achieved due to personification. Personification of a thing, in this case the dead body (the smell of which we know is actually the limburger cheese) is the reason the humor of Mark Twain’s story is increased.
Just to review the plot, we should briefly describe the story of our narrator. He is taking the dead body of his friend Hackett home to be buried. Or, perhaps we should say, the narrator thinks that is what he’s doing. In fact, our narrator is simply transporting a box of guns. Unfortunately for the narrator and the expressman on the train, someone puts a package of limburger cheese on the pine box of guns. The resulting smell during the long train trip makes both characters think Hackett’s dead body is rotting. The smell of the cheese gets too intense, and the two characters try to mask the odor. Unfortunately, everything they do (smoke cigars, throw chemicals, start fires) only adds to the cheese smell. The two decide to suffer in the cold as a result. The expressman dies, and the narrator becomes a sick invalid.
Personification is a literary concept where human qualities are attributed to a thing. In this case, the “thing” given human qualities is a dead body, a corpse. Thompson, in his disgust at the smell of what he doesn’t know is the cheese, accuses the corpse of trying to offend the two men in an olfactory way. Quite simply, Thompson (and as a result, Mark Twain) is using this concept of personification. Why does this add to the humor? It is absolutely ludicrous to think that a dead body would “deliberately try” to cause problems. It has ceased to be human. It is simply a thing. The other irony is that the “thing” actually causing the problem isn’t the corpse at all, it is the limburger cheese.
In conclusion, it is important to note that the kind of irony involved here is dramatic irony. Dramatic irony exists when a character doesn’t know something that the reader knows. In this case, the two characters don’t know that the smell is coming from the cheese. Because we, as readers, know this fact, this dramatic irony adds to the humor.