Edit: Thanks /u/ivymikey and /u/hillsonghoods!
I remember reading about this some 20 years ago in The Bathroom Reader. According to that, spinach was chosen because of an error. A German chemist, Erich von Wolf, discovered how much iron was in spinach - 3.5 mg per 100g. However, when he wrote his findings, he placed the decimal one spot over and people thought that spinach contained 35 mg per 100g. When Popeye was created, the writers used spinach as his "superfood" because of its supposed high iron content. In reality, Popeye's superfood could have been beets or cabbage or any other green, leafy vegetable as spinach isn't really any better than other green leafy veggies.
But then I figured, "hey, I read that 20 years ago, I should double check and find some sources, just in case."
According to this article from Wired magazine a few years ago, a scientist wrote a paper in 1980 that restated the story. In the article, he mentions that in 2009, another paper was written that traced the origin of the story. The author of the 1980 paper was unsure of the source of the story, being so long ago. The 2009 author found another professor had talked about the misplaced decimal in 1973 and thanked another professor (whom couldn't be found) for this information in a 1977 letter.
Long story short, the real value of iron in spinach was known by 1892 and the US government was publishing information about it by 1907 so writers of Popeye would have known about it before they started.
This article claims that the US government got Popeye to eat spinach in the 1930s as a way to encourage Americans in the Great Depression to eat spinach as both an iron-rich replacement for more expensive meat and as a canned food. It mentions that spinach became a very popular food around then. The article also pushes the same debunked story of the misplaced decimal point, so how accurate is it? This website mentions that Popeye didn't get strength from spinach at first, but from rubbing a Whiffle Hen. It wasn't until 1932 that Popeye began eating spinach.
I've found a couple articles that mention that spinach is becoming more popular these days, surpassing the popularity that it enjoyed in the 40's and 50's.
So what does all this mean? We can safely assume that the creator of Popeye did not choose spinach because of the German-Iron myth, at least not without knowing that it was false. The Guardian claims that he did, but without a source, we cannot be sure that the Guardian is any more accurate than any other source. There is some evidence that Popeye didn't begin to eat spinach until 1932 and that it could have been pushed by the US government. Spinach reached it's zenith of popularity in the 40's and 50's, possibly attributed to Popeye, so it would make sense that the USDA or FDA pushed for it. Whatever the case may be, if you want to be strong to the finish, you should probably eat some sort of leafy green vegetables.
From about the 1970s, there was a factoid going around - which has been repeated in a deleted comment or two here - about how there were errors in the calculation of the amount of iron in spinach, and how that error was never corrected. This, allegedly, meant that the makers of Popeye thought that spinach was an especially good source of iron and that this was the reason why Popeye eats the stuff. This factoid was very popular: it was spread by some heavy hitting medical journals, including the British Medical Journal and The Lancet. The factoid is also untrue. It appears to be based on a serious of misinterpretations and Chinese whispers, and it's been spread because skeptics enjoying having a good story to tell about why it's good to be really careful with data.
The people pushing the factoid are absolutely correct that spinach is not an especially good source of iron, but scientists did know this in the 1920s and 1930s. While there had been an error in calculations of the amount of iron in spinach in the 1870s, it had long been rectified; American government health advice of the period had more correct iron levels, and did not appear to see spinach as a meat substitute but rather as a vegetable worth eating for its vegetable-ness. Mike Sutton's paper on the myth, for example, cites a 1935 science newsletter with the title Spinach Overrated As A Source Of Iron, for example, which explicitly mentions Popeye in passing.
And it looks as if the spinach has lots of iron thing was never strongly pushed by the Popeye character in E.C. Segar's cartoon. Segar was the cartoonist who originally created Popeye as an incidental character in his long-running cartoon strip in 1929. He did not seem especially fussed about iron in the Popeye cartoons of the era according to Sutton, who claims to have read every strip of the comic from the 20s to the 30s.
Instead, Segar's motivations for having Popeye eat spinach was more of a generalised 'eat your greens, kids!' thing. Sutton, for example, reprints a 1932 Popeye cartoon where a woman sees Popeye eating raw spinach and exclaims "Good heavens! Are you a horse?!" (the implication in the cartoon being equivalent to the way that meat lovers today might call salads 'rabbit food'). Segar has Popeye reply, "Spinach is full of Vitamin A's and tha's what makes hoomans strong an' helty". Popeye's advice about the vitamin content of spinach is basically still pushed by the NHS's advisory website in the UK, so it's pretty good food advice for 1932. Sutton claims this is the first specific explanation in the comic of why Popeye eats spinach.
Sutton also provides several other examples of Popeye editorialising about the goodness of spinach, for example this from July 1931:
"Special letter to me children frens – Dear kids – the reasin why I yam so tough an’ strong is on account of I has et spinach when I was young – An if you youngstirs wants to be helty like me ya got to eat yer weeds like yer maw sez – yers trulie, Popeye."
Laura Lovett argues that there was something of a crisis of child malnutrition in the early 20th century, and that Popeye's food advice was made with this crisis very clearly in mind. A report in 1907 had found that about a quarter of children were underfed; a separate report found that over half of African-American children in Mississippi in the 1920s were malnourished. This was a big deal in the American press at the time - Lovett claims there were over 50 articles about this in 1922 alone. The 1920s was also an era where there were increasing efforts at educating people about things like vitamins and what proper nutrition consisted of; it was in this era, according to Lovett, when the catchphrase "eat your vegetables, there are children starving in [insert country here]" began to be used as a public health message. So it was unsurprising, in this context, that E.C. Segar would have gotten Popeye to eat spinach - someone who reads the papers likely would have been aware that kids needed more encouragement to eat 'good' food.
As to why it was spinach and not beets, Sutton doesn't say. Personally, I reckon that the choice of spinach was largely a literary device to pick a single vegetable and stick with it - "Popeye eats spinach" is clearly more memorable than "Popeye eats his veggies" would have been.
It might be that the animated cartoon series about Popeye, which started from 1933, spread myths about the iron levels of spinach later on. It could have been something in the animated series that made the writer of the 1935 science newsletter mentioned above feel the need to correct the record. But in the original cartoon strip by Segar, Popeye's reasoning seems to have been quite sensible advice about spinach having good levels of vitamins.
Sources: I think I tracked down the academic paper that I suspect most of the journalistic pieces /u/ivymikey linked to are based off, a 2010 paper by Mike Sutton in the Internet Journal of Criminology. There's also a paper by Ole Bjorn Rekdal in Social Studies Of Science which largely contextualises the Sutton paper, but does so quite well, and an article by Laura Lovett from 2005 that contextualises Popeye's food advice in terms of issues with child malnutrition in the 1920s.
Follow up question on this.
In this article (http://www.alternet.org/story/21206/what%27s_in_popeye%27s_pipe) it is heavily suggested that Spinach was a Metaphor for Marijuana as there are some references to spinach as marijuana in the same period Popeye was created.
In the same article, they also state that in the 30's it was thought that Marijuana gave you super strength. Could someone confirm this link? It would also explain why Popeye sometimes uses his pipe to take the Spinach.