As in other stories, in "The Last Leaf" O. Henry exploits the romantic wish that people are inherently good and unselfish and possessive of an innate dignity. And, as is also characteristic of O. Henry, in this story the narrative is constructed on the basis of some contradiction.
The contradiction in "The Last Leaf" exists in the character of Mr. Behrman, an older man who is "a failure in art." For forty years he has painted, and for forty years he has always been going to paint a masterpiece, yet the canvas stands empty in his little basement apartment. Every once and a while he receives a commission to paint for an advertisement or for some commercial enterprise. In addition, he earns some money as a model for young artists in Greenwich Village who cannot afford a professional model.
Therefore, for Behrman to become the hero who is the cause of Johnsy's change of heart about dying, there is, indeed, a contradiction. This contradiction exists in his heroic and loving act of going out into the wet, cold winter night, climbing a ladder, and painting an ivy leaf upon a brick wall so that Johnsy will not fulfill her promise of dying when all the leaves fall from the vine.
Behrman, an old curmudgeon who complains about just going upstairs and modeling for Sue, and who has procrastinated for forty years on painting his "masterpiece," braves the icy cold and unselfishly risks his own health because he loves Johnsy. Truly, then, Old Behrman becomes heroic in his final act, and does, indeed, contradict his unmotivated nature as he paints his "masterpiece," at last.