Hashem presents Bnei Yisrael three national commandments to perform when they settled the Land: they were to request a king, eliminate the offspring of Amalek, and set up a Beit HaMikdash. As Parshat Shoftim (17:14-20) indicates, it was very important that Bnei Yisrael appoint a king. Indeed, the horrible events recorded in Sefer Shoftim of Pesel Michah, a public idol, and the concubine of Giv’ah, whose rape resulted in civil war prove the necessity for a king. If there was a king at that time neither would have happened as indicated in the Pesukim (Shofetim 18:1, 19:1, and21:25). Additionally, all the prophecies about the times of Mashiach include a description of a king from the descendants of David HaMelech (see, for example, Yeshaya 11:1-5). Thus, a king is clearly a very necessary institution.
When Bnei Yisrael actually asked for a king, however, they were not motivated by the need to fulfill the word of God, but rather to mimic the surrounding nations. The Navi Shmuel responded to the people with anger and disappointment, because the people demanded a king for the wrong reasons. Since the intent of the people was wrong, their first king, Shaul, could not rule permanently. The Torah in a way foreshadows this error, because the Pasuk describing the people’s request says it says that they shall as for a king “like all the nations that surround me” (see Ramban’s comments). These are the exact words that were asked to Shmuel. Afterwards, however, the Torah makes a point of describing how the king should be different from all the other nations, which unfortunately the people in Shmuel’s time did not understand.