There are many theories, including:
- a demon, since Paul says it was a "messenger of Satan"
- a physical affliction: "incessant temptation, dogged opponents, chronic maladies (such as eye problems, malaria, migraine headaches, and epilepsy), to a speech disability"
- false teachers
(My personal theory is that it was his eyesight; but the majority of experts do not agree!)
We simply don't know for sure.
As for why, that's in the verse you quoted, to keep Paul "from becoming conceited".
We're all subject to pride and Paul, as a great leader in a new movement and chosen by Jesus Himself had reason (in man's eyes) to be conceited (he even said so himself). This "thorn" was apparently to prevent that, so that his work could continue without anyone being able to find fault with him.