There's a post on the NY Times book blog, Paper Cuts, about Kennedy's famous speech and alleged howler, including a YouTube clip of Kennedy giving the speech. Steve Coates talks to Michael Jennings, Professor of German at Princeton, asking whether 'Ich bin ein Berliner' really does mean 'I am a doughnut.' (Jennings argues that it could in fact be a more nuanced way of stating one's affiliation with Berlin - 'Ich bin Berliner' meaning 'I'm a native of Berlin,' 'Ich bin ein Berliner' indicating more recent arrival.) Somewhat oddly, Coates keeps asking whether it's ungrammatical. I think even those who think it means 'I am a doughnut' have never claimed it was ungrammatical; 'I'd love to be an Oscar Meyer Wiener' is perfectly grammatical, but it would be an odd thing to say to underline, as it might be, solidarity with the US against al-Qaedah.
Whatever the sentence may be able to mean, anyway, it is as an assertion of doughnuthood that it is remembered, loved and recycled by local advertising agencies, a source of comfort to the linguistically-challenged Berlinerin.