The narrator of the short story "The Devil and Tom Walker" describes how Tom sets up his business as a money lender "at this propitious time of public distress," when people were absolutely desperate for a way out of their financial troubles.
The question you posed is about how the narrator's humor makes a point when he says that "in proportion to the distress of the applicant was hardness of his terms".
To see why this is even funny, it's important to take a look at the previous sentence. It says: "Thus Tom was the universal friend of the needy, and he acted like a 'friend in need;' that is to say, he always exacted good pay and good security." When we read this sentence, we expect to see more about how Tom is a good guy, a savior for these folks who really need the money he's lending them... and then we read the first part of the next sentence ("in proportion to the distress of the applicant...") and think "Ah ha! This sentence is totally going to say, "The more stressed-out the person applying for a loan was, the nicer and the more comforting Tom was to them."
Surprise! It's the opposite. The next sentence pretty much says "The more desperate and stressed-out people were, the tougher Tom was on them and the more he took advantage of their desperation."
So here, the narrator's point is that Tom's behavior is evil and two-faced. He's acting like he's helping people out, yet he's actually making their desperate times even worse. The humor of the sentence structure makes for a surprising little twist, which shocks readers and emphasizes Tom's awful hypocrisy and greed even more than if the narrator had been straightforward and just said, "Tom was especially bad to the people who were most in need of his help."