It's rude to joke about someone who is dead.
Rudy is hanging out with his friend Sam who has been down in the dumps recently due to the passing of his grandfather.
Rudy wants to lighten the mood and cheer Sam up.
Rudy tells Sam a funny knock-knock joke that he heard the other day.
Rudy makes a joke that involves Sam's recently deceased granfather.
Sam finds the joke hilarious and it cheers him up considerably.
Sam is offended and further saddened at the mention of his grandfather.