The correct answer is βThe speaker wants to honor and celebrate Lincoln's accomplishment of winning the war. β
Indeed, Walt Whitman lived through the Civil War and came to admire and appreciate Lincoln for his efforts to preserve the Union up to his ultimate sacrifice. This is called an elegy, i.e. a poem that celebrates the accomplishments of a person who has died and laments such demise. In this extended metaphor the ship is the USA, the Union and naturally the Captain is its president, Lincoln. Like a ship, the Union has survived a storm that βweather'd every rackβ of the ship and the poem has a bittersweet flavor for it both celebrates the hard won victory but mourns the death of the person most responsible for it.