In nineteenth-century poetry, poems often use the first line for the title, and "When Lilacs Last in the Dooryard Bloom'd" does just that. Still, the title is mighty important in ways beyond that conventional technique. Those lilacs are no ordinary lilacs and the idea of them being "last in the dooryard bloomed" is also no accident.
When we think of spring and lilacs, we immediately imagine rejuvenation, life picking up again after winter, and perhaps even ideas related to hope and perseverance. Considering that Whitman was writing an elegy here, the significance of a title that evokes ideas of hope and perseverance makes a lot of sense to us. The last thing anyone really wants after losing a loved one is to wallow in even more pain and despair. We kind of need ideas like "lilacs last in the dooryard bloomed" to get us thinking more about life's continuance and the perseverance of the human spirit.
But there's also something interesting going on here in the syntax of the title. "When Lilacs Last in the Dooryard Bloom'd" can be read in two different ways. You could argue that the word "last" refers to the final lilacs to bloom for the season, as late blooming flowers. Or, you could say that "last" relates to the idea of memory, as in "the last time the lilacs bloomed in the dooryard" (as in last spring). Either way, Whitman has managed to get us thinking in equally optimistic ways, whether he intended to or not. Whether we imagine the hope that those remaining lilacs will eventually bloom, or thinking more along the lines of yearly rejuvenation and renewal, we're feeling mighty hopeful right from the get go.
So, as far as meaningful titles go, this one kind of takes the cake. Any way you cut it, there's hope to be found in the title alone. Even in the midst of death, ol' Walt gives us flowers.