Yeah, unfortunately a lot of people misquote Nietzsche. It's kind of a recurring joke among those who are familiar with his work. For example, the phrase "God is dead" is often taken completely out of context and used to justify things that Nietzsche himself never intended.
In this specific example, Nietzsche is not at all endorsing the statement that that which does not kill you actually makes you stronger. That's only one part of the aphorism, not the entire thing. And the collective resonance of the phrases is really what makes the aphorism:
Out of life's school of war: What does not destroy me makes me stronger.
(Aus der Kriegsschule des Lebens: Was mich nicht umbringt, mach mich stärker.)
The above-quoted line comes from a list of aphorisms in Twilight of the Idols that Nietzsche has labeled "Maxims and Arrows". In this section, he reflects on a series of statements that people commonly believe, but are either obviously fallacious or turn out to be true only in a surprising and unusual way. The name "arrow" reflects his hope that his analysis will pierce through people's typical complacency.
He's really making fun of the statement. And in typical Nietzschean style, he attempts to refute it using snarky, obscure jabs rather than nuanced or rigorous analytical analysis. He evokes images of hardships that are almost nearly fatal, from the physical to the emotional, to show how ludicrous it is to claim that repeatedly adversity could ever be a source of strength. In fact, people who are repeatedly confronted with such hardships tend to become depressed, unproductive, and even suicidal.
In pointing out its ironic falsity, Nietzsche also makes the point that the statement is quite useful for controlling others: convincing them to be strong and push through difficult situations, cajoling them into giving up their own lives for the larger cause of their country ("the military school of life"), etc.
In fact, Nietzsche very much despised the statist notion of warfare, as is clearly evidenced in this excerpt from "The Wanderer and His Shadow" (the third section of Human, All Too Human, 1878):
The means to real peace. No government admits any more that it keeps an army to satisfy occasionally the desire for conquest. Rather the army is supposed to serve for defense, and one invokes the morality that approves of self-defense. But this implies one’s own morality and the neighbor’s immorality; for the neighbor must be thought of as eager to attack and conquer if our state must think of means of self-defense. Moreover, the reasons we give for requiring an army imply that our neighbor, who denies the desire for conquest just as much as does our own state, and who, for his part, also keeps an army only for reasons of self-defense, is a hypocrite and a cunning criminal who would like nothing better than to overpower a harmless and awkward victim without any fight. Thus all states are now ranged against each other: they presuppose their neighbor’s bad disposition and their own good disposition. This presupposition, however, is inhumane, as bad as war and worse. At bottom, indeed, it is itself the challenge and the cause of wars, because, as I have said, it attributes immorality to the neighbor and thus provokes a hostile disposition and act. We must abjure the doctrine of the army as a means of self-defense just as completely as the desire for conquests.
And perhaps the great day will come when people, distinguished by wars and victories and by the highest development of a military order and intelligence, and accustomed to make the heaviest sacrifices for these things, will exclaim of its own free will, “We break the sword,” and will smash its entire military establishment down to its lowest foundations. Rendering oneself unarmed when one had been the best-armed, out of a height of feeling—that is the means to real peace, which must always rest on a peace of mind; whereas the so-called armed peace, as it now exists in all countries, is the absence of peace of mind. One trusts neither oneself nor one’s neighbor and, half from hatred, half from fear, does not lay down arms. Rather perish than hate and fear, and twice rather perish than make oneself hated and feared–-this must someday become the highest maxim for every single commonwealth.
Ironically, just as Nietzsche had observed elsewhere (and as some readings of the work might claim, was attempting to demonstrate through the "Maxims and Arrows" section), writers are remembered primarily for and by such simple aphorisms. The well-known American rapper, Kanye West, even includes a paraphrase in his hit song Stronger (again, requoted without the phrase that prefaces it):
Th-th-that that don't kill me
Can only make me stronger
Surely this apparent demotion of Nietzsche to "idle talk" would only incense Heidegger, but Nietzsche appears to have grown content with this state of affairs some time later, following his initial rant against modern media systems in Human, All Too Human.