"An Invalid's Story" seems old-fashioned now, but it was undoubtedly considered very funny when Mark Twain wrote it. Americans were simpler in those days. Most of them lived on farms or in small towns. Life itself was much simpler. What is supposed to be funny is the fact that the two men don't realize that the bad smell is created by the Limburger cheese but assume it is coming from the decaying corpse. This is situational irony. The reader would have to visualize the entire setting and the two characters in order to think it was funny. But perhaps we have been spoiled by watching movies and television and can no longer visualize scenes and situations the way readers had to do before movies and television were invented. The other thing about the story that is supposed to be funny--although it may not seem funny to modern young readers--is the dialogue of the expressman. He is described as simple and good-natured. He doesn't like to complain because he feels obliged to show respect for the dead man and sympathy for the narrator, but the smell keeps getting worse and worse, until it finally drives them out into the cold. A lot of Mark Twain's humor was based on his depiction of colorful characters and his replication of their use and misuse of American English. Mark Twain's great novel Huckleberry Finn is full of simple, rural characters and imitations of their colorful vernacular.
It is noteworthy that Mark Twain, like any good fiction writer, tries to appeal to all five of the reader's senses. In this story the appeal to the reader's sense of smell is unusually strong. The reader sees and hears the expressman, smells the cheese, is touched by the bitter cold, and tastes the strong cigars. In addition to the smell of the Limburger cheese, there are all the other smells the men create in their attempt to camouflage the smell they think is coming from a decaying corpse.