The evidence that the appointment of a Khalifah is obligatory upon all Muslims is in the Quran, Sunnah and the Ijma' (consensus) of the Sahabah. ...
"And rule between them by that which Allah revealed to you, and do not follow their vain desires away from the truth which came to you". [TMQ 5:48]
"..Verily the 'Hukm' (command, Judgment) is for none but Allah.." [TMQ 12:40]
"Whoever does not judge by that which Allah has revealed, they are disbelievers" [TMQ 5:44]
"Whosoever does not judge by that which Allah has revealed, such are oppressors" [5:45]
"Whosoever does not judge by that which Allah has revealed, such are transgressors" [5:47]
...
Moreover, the Prophet ordered the Muslims to obey the Khaleefah and to fight those who dispute his authority as Khaleefah, which indicates an order to appoint a Khaleefah and to protect his Khilafah by fighting against whosoever disputes with him.
...
Khilafah.
1. Ibn Khaldoon defined it as: A representation, of the one who has the right to adopt the divine rules, aimed at protecting the Deen and ruling the world (Dunia) with it.
...
In summary, Khilafah is the ***POLITICAL**** (emphasis mine) system in Islam. It is responsible for implementing the Islamic system (be it social, economic, educational, foreign policy,...) and maintaining its implementation. It is also responsible for spreading the message of Islam to the world.
http://www.islamic-world.net/islamic-state/theobasis.htm