The simple meaning of the phrase is that someone wondering whether or not he or she exists is in itself proof that that one exists to do the thinking. The statement comes form Descartes, the one who attempted to arrive at a fundamental set of principles that one can know as true without any doubt, and to achieve this, he employs a method called hyperbolical/metaphysical doubt, where he rejects any ideas that can be doubted, and then reestablishes them in order to acquire a firm foundation for genuine knowledge. So he doubted his existence, then used to fact of himself doubting his existence in itself as a proof that he exists. Since he has to exist in the first place to do the thinking/doubting.
And according to Wikipedia, "The phrase became a fundamental element of Western philosophy, as it was perceived to form a foundation for all knowledge. While other knowledge could be a figment of imagination, deception or mistake, the very act of doubting one's own existence serves to some people as proof of the reality of one's own existence, or at least that of one's thought".
So, what is my problem? The statement "I think, therefore I am", or sometimes "I think, therefore I exist", is too clear to be misunderstood, right? Yet for some unknown reason, my subconscious used to interpret it to "I think, because I exist". I kept on wondering why I was doing so. The fact is that in School or whenever anyone mentions this statement, at least the people I knew, used to us it as an evidence of how thinking is a good thing. They used it as an opening phrase whenever they want to tell us that thinking is of a great value. Hence my un-conscience inverse interpretation of the statement.
Another thing to add here, they all stick to the term "think", and they never use the word "doubt", unless their register is to attack Descartes and his Cartesian Scepticism. A lot of them always wanted to make it clear that you cannot doubt everything. Your existence, just like the existence of God and how he looks like are among things that you aren't advised to be sceptic about. Some where more liberal about this, some where more strict, adding more things to the "not allowed to question" list. But, at the end of the day, they all agreed that there are things that you cannot question or doubt.
May be that's one more reason why the statement was always told to us as way to encourage us to think, but not to doubt everything, including our own existence.