It appears that Gimpel is the fool, very gullible, someone who will believe anything you tell him. The townspeople take advantage of Gimpel's kindness, innocence and faith in human nature, by tricking him and publicly humiliating him. Once he marries Elka, he appears to be the biggest fool who ever lived.
But Gimpel is not simply an idiot, or a fool, who does not see the truth, he is a man with a kind and generous heart who loves the children his wife has with other men.
He had received some advice from the Rabbi, which Gimpel takes to heart and uses as a guide to live his life.
"The rabbi tells Gimpel, "It is written, better to be a fool all your days than for one hour to be evil. You are not a fool. They are the fools. For he who causes his neighbor to feel shame loses Paradise himself."
Even at the end of the story when Gimpel is tempted to try to fool the townspeople, he cannot go through with it. He is warned by the spirit of his dead wife to remain true to his beliefs.
"You fool! Because I was false is everything false too? I never deceived anyone but myself. I'm paying for it all, Gimpel." Gimpel awakes, sensing that "everything hung in the balance. A false step now and [he'd] lose Eternal Life."
The story has a moral. People who live their lives with kindness, compassion and forgiveness are not fools. People who think they are getting away with sinful or hurtful behavior are the real fools.