Rashi explains that the number forty is not accurate, since he only receives thirty-nine lashes. Various explanations are offered by the commentators to explain why the Torah chose to write the number forty when — in reality — it should read only thirty-nine. The Divrei Yecheskel offers an explanation which carries within it a profound message.
Man must realize that, regardless of one’s level of achievement, it is inconceivable to attain the degree of sublime purity necessary to stand before Hashem. Likewise, whatever our lot in life, it is still not sufficient compensation for that which we “owe” Hashem. Nonetheless, we are implored to do our utmost to serve Hashem. Upon repenting, we must seek contrition by doing our maximum and hoping that it will effect penance for our sins. Above all, man must be aware that he has not completed his mandate.
This is the Torah’s message. You have received thirty-nine lashes, but be aware that you should have had a greater punishment. Whatever our lot in life, we must thank Hashem for His beneficence in sustaining us despite our deficiencies and iniquities.