From Wikipedia:
According to an urban legend, Kennedy allegedly made an embarrassing grammatical error by saying "Ich bin ein Berliner," referring to himself not as a citizen of Berlin, but as a common pastry<3>:
Kennedy should have said "Ich bin Berliner" to mean "I am a person from Berlin." By adding the indefinite article ein, his statement implied he was a non-human Berliner, thus "I am a jelly doughnut".
The legend seems to stem from a play on words with Berliner, the name of a doughnut variant filled with jam or plum sauce that is thought to have originated in Berlin.
In fact, Kennedy's statement is both grammatically correct<4> and perfectly idiomatic, and cannot be misunderstood in context. The urban legend is not widely known within Germany, where Kennedy's speech is considered a landmark in the country's postwar history.<5> The indefinite article ein can be and often is omitted when speaking of an individual's profession or residence but is necessary when speaking in a figurative sense as Kennedy did. Since the president was not literally from Berlin but only declaring his solidarity with its citizens, "Ich bin Berliner" would not have been correct.<6>
(snip)
The citizens of Berlin do refer to themselves as Berliner; what they do not refer to as Berliner are jelly doughnuts. While these are known as "Berliner" in other areas of Germany, they are simply called Pfannkuchen (pancakes) in and around Berlin.<10> Thus the merely theoretical ambiguity went unnoticed by Kennedy's audience, as it did in Germany at large. In sum, "Ich bin ein Berliner" was the appropriate way to express in German what Kennedy meant to say.<11>
Although it is false, the legend has since been repeated by reputable media, such as the BBC (by Alistair Cooke in his Letter from America program),<12> The Guardian,<13> MSNBC,<14> CNN,<15> Time magazine,<16> The New York Times<17>, and in several books about Germany written by English-speaking authors, including Norman Davies.<18>.
http://en.wikipedia.org/wiki/Ich_bin_ein_Berliner