What is this strange sentence by Walt Whitman?
The literal meaning
The meaning they told you in school is not the literal meaning.
"A is no more X than B" literally means that the degree of X possessed by A is no greater than the degree of X possessed by B. Or you could say that B has at least as much X as A. Usually there is an implication that both A and B possess X in approximately equal degree. For example:
Fresh spinach is no more expensive than canned spinach.
That is, the price of fresh spinach is not greater than the price of canned spinach. Probably you thought canned spinach was cheaper than fresh, but actually it's not.
Similarly for comparatives in -er rather than more:
My left shoe is no longer than my right shoe.
Figurative meanings
Often people use the expression "A is no more X than B" figuratively, to contradict the proposition that A possesses X in high degree.
"Jethro is crazy."
"Oh, come on. Jethro is no crazier than you are."
The idea here is to deny that Jethro is crazy, not directly, but by implying it. The listener is expected to understand the literal meaning, and to apply it on the assumption that "you" aren't crazy at all. Since "you" aren't crazy at all, and Jethro is not crazier than you are, it follows that Jethro is also not crazy at all.
Sometimes this indirect way of speaking is more effective than saying it directly, like "No, Jethro is not crazy". Asking the the listener to compare his level of craziness to Jethro's encourages him to pause and come to his senses. Maybe the listener is just upset. If he pauses and compares Jethro to himself, he might see that he is mistaken, whereas directly contradicting him might only escalate the difference of opinion.
What you were told in school was an attempt to skip understanding this figure of speech by telling you a literal substitute. That's hopeless. To understand the figure of speech, see how people play off the literal meaning. Then you'll be able to understand how people use it and vary it for rhetorical effect.
In fact, the same comparison can have the opposite meaning:
"Look at him ride that snowmobile straight into a fence. Jethro is crazy."
"No crazier than you, ha ha!"
This time, the second speaker means that the first speaker also rides around recklessly, courting danger. The second speaker is agreeing that Jethro is crazy, and saying that the first speaker is at least as crazy as Jethro—probably crazier.
By the way, this kind of figure of speech is called a "litotes": denying the opposite of what you mean in order to affirm it. It's a kind of understatement. A more ordinary example is "Walt Whitman was no fool." This really means "Walt Whitman was very wise."
Walt Whitman's meaning
Spelled out explicitly, Walt Whitman's sentence means:
You probably think that the present is certain and the future is uncertain. Well, think again! If you think about it carefully, you will see that the present is uncertain, too—and the difference between them is actually negligible.
Whitman doesn't mean that the future is certain. As in all the figurative uses of "no more than", he's calling upon the literal meaning. You know that the future is uncertain. Whitman is saying that the future isn't more uncertain than the present: that is, the present is also uncertain.
The context
To understand the quotation, consider the context. It's from a poem called Song of the Broad-Axe. Here are the surrounding lines:
Muscle and pluck forever!
What invigorates life, invigorates death,
And the dead advance as much as the living advance,
And the future is no more uncertain than the present,
And the roughness of the earth and of man encloses as much as the delicatesse of the earth and of man,
And nothing endures but personal qualities.
What do you think endures?
Do you think the great city endures?
Or a teeming manufacturing state? or a prepared constitution? or the best-built steamships?
Or hotels of granite and iron? or any chef-d’oeuvres of engineering, forts, armaments?Away! These are not to be cherish’d for themselves;
They fill their hour, the dancers dance, the musicians play for them;
The show passes, all does well enough of course,
All does very well till one flash of defiance.
The point, as I understand it, is that human attempts to create great, lasting, refined, and especially civilized things that impose collective order on individuals—great cities and economies, constitutions carefully designed to secure lasting law and order, elegant buildings made of stone and metal, brilliant works of civil engineering, etc.—all fail, for the only thing that endures is "muscle and pluck": just the innate ability of people to deal with their situation as well as they can, using plain physical strength and some cleverness and courage. The raw, instinctive roughness of life endures, not the attempts to reshape it into something "delicate".
The figure of speech
To understand the figure of speech, first you have to understand the literal meaning of "no more than", explained in my other answer. Now here's how the figure of speech works.
Normally you would say that the future is more uncertain than the present. That stands to reason: the further away something is from what you can directly observe right now, the less certain it is. The present is certain, the future is uncertain. By denying this, Whitman is trying to throw you for a loop: "What? That's crazy! Of course the future is more uncertain than the present. Is this guy an idiot or something?" Literally, Whitman is denying the obvious truth. That triggers a rapid mental search for a different interpretation, one that makes sense.
First, you realize that the present actually is uncertain. It's not at zero uncertainty, it's actually filled with uncertainty. Here are the previous few lines:
The sack of an old city in its time,
The bursting in of mercenaries and bigots tumultuously and disorderly,
Roar, flames, blood, drunkenness, madness,
Goods freely rifled from houses and temples, screams of women in the gripe of brigands,
Craft and thievery of camp-followers, men running, old persons despairing,
The hell of war, the cruelties of creeds,
The list of all executive deeds and words, just or unjust,
The power of personality, just or unjust.
Now that you see that the present is uncertain, this opens up some wiggle room for the future. They're both uncertain, future and present. He's not talking about the degree of confidence you can have about the future, he's talking about the quality of present and future life: filled with uncertainty. It's like saying "the future is no darker than the present."
But why use the present to set an upper bound on the uncertainty of the future? Why talk as if he's narrowing down the uncertainty of the future? Because his point is that it's going to stay this way. There will be no progress, at least none that matters, and even that won't last. Life is now, has always been, and always will be rough, brawny, unrefined.
The "double-reversed" expression makes the sentiment seem, at least to me, like a profound basis for optimism, unlike if he had said "The future is as certain as the present." Uncertainty is usually thought of as a bad thing, and the wording denies the greater uncertainty that we normally associate with the future, paradoxically encouraging a kind of appreciation of the uncertainty of the present.