Despite the fact that different Arab variants are called "dialects" in they are actually separate languages. Tunisian is incomprehensible to an Egyptian for instance and Syrian is considerably different than both. No one speaks Modern Standard Arabic at home, and many uneducated Arabs have trouble using it. However, it is used for most official and intellectual activity. Why is this?
actually separate languages
First off, there is no scientific objective difference between what is a language and what is a dialect. Mutual intelligibility, while often cited as the most important factor by non-linguistis, is incredibly insufficient if you're trying to come up with a consistently applicable rubric. So you can't ever objectively say that two related varieties of speech are 100% certainly dialects and not languages, or languages and not dialects. It's not a linguistic reality. Happy to expand on that if you'd like. But for now, moving on…
However, it is used for most official and intellectual activity. Why is this?
MSA is what's called the prestige dialect. Many languages have prestige dialects. In American English, until recently news anchors operated in a somewhat uniform dialect, even if it wasn't their own. Modern Standard Arabic is common as it is as a result of being the prestige dialect of Arabic.
So then the question is what made it that way. Prestige dialects are considered socially more refined. They get this status through having social significance through literary traditions, prestigious (wealthy,educated,respected) speakers, or other factors that make place them above other dialects. As you probably know, MSA is developed on Qur'anic Arabic. It doesn't get much more prestigious than the word of God.
many uneducated Arabs have trouble using it
This is another factor that contributes to a dialects prestige. It provides another defining factor between who's in and who's out.
link about linguistic Prestige below because Reddit doesn't like parentheses in links: http://en.wikipedia.org/wiki/Prestige_(sociolinguistics)