Amina Inloes, Amina Inloes is originally from the US and has a PhD in Islamic Studies from the University of Exeter on Shi'a hadith. She is the program leader for the MA Islamic Studies program at the... Answer updated 1 year ago

This may be an overly pedantic or literal response, but, in my view, the main reason why you "have" to do something in Islam is that it is prescribed in scripture (Quran/hadith) (and/or other methods of deriving jurisprudence).

Since the Quran and hadith seem to indicate that women should wear hijab, women should wear hijab. Any other explanation - unless directly stated in these sources - is either (a) a guess, and (b) oftentimes just personal opinion or what is popular to say at the time.

Anyway - based on what is in the Quran/hadith - most people would say that the hijab serves the purpose of (a) modesty and maintaining a culture of modesty in society (also, to be blunt, discouraging relationships and hence birth out of wedlock), and (b) social signalling - for instance, identifying a woman as a Muslim, or signifying that one is a practicing Muslim.

Clothing in general, historically and today, has served to communicate a complex set of messages about identity (such as culture, tribe, nationality, religion, occupation, social class, etc), and varying forms of hijab do that as well. 

Also, in most Muslim cultures, it is seen as more dignified or more traditional for men to cover up a fair amount. 

Today some people also point to other possible messages or purposes of the hijab, such as discouraging excessive consumerism regarding beauty and beauty products, emphasizing a woman's right over her own body (versus feeling compelled to show it off), as a political or ideological statement, or as a form of self-motivation to act in a better way (in that wearing hijab often makes one more conscious of one's actions). Some people also say it might promote a stronger marriage or stronger family values. Some people might also say there is a convenience factor or it is better for one's well-being (to avoid sun damage).

Some people argue that hijab isn't necessary for modesty and point out that many cultures have modest dress which doesn't cover the hair. While I agree, now that we have seen the direction of Western culture and, to some extent, the global society, I have personally come to feel there is a virtue in having a minimum dress code in society today because, without it, there is pressure to show off a lot. 

Anyway because it is a very prominent subject in the modern era, you will find a lot of things written about hijab and you can read elsewhere to get a variety of views.