Kennedy said nothing wrong.
In 1963 John F. Kennedy gave a speech in front of the Schoeneberg city hall in Berlin. The speech was supposed to be motivating, because about two years earlier the Berlin wall had been erected. Kennedy gave this speech in English, with an interpreter delivering a German translation. There was however one sentence that was in German: “Ich bin ein Berliner.” And believe it or not, even in 2010 there are English-speaking fellows claiming that this would have meant “I am a jelly doughnut.”
Short version: Wrong. Kennedy was absolutely correct.
Longer version: First of all, before his speech Kennedy asked a German how to express in one German sentence that he himself felt to be a Berlin citizen and the person asked gave the sentence Kennedy used. Do you honestly think a German, himself Berlin citizen, would not know how to say this in his native tongue?
Whether there is an indefinite article or not does not matter at all. It changes the meaning just a little, but still means “I am a person born and/or living in Berlin”.
The “jelly doughnut” people are referring to is called “Berliner Pfannkuchen” by its full name. This pastry has a number of other names too, but there are areas in Germany, where people only call it “Berliner” just out of convenience. This however does not apply to Berlin and the surrounding Brandenburg, where it is simply called “Pfannkuchen” – without the “Berliner” in front.
So, whoever created this myth had some understanding of German and the country, but not enough, because that person very likely did not live in or near Berlin…