In the Book of 1st Samuel, Israel looks to Samuel to ask God for a king:
1 Samuel 8:4-7: "Then all the elders of Israel gathered together and came to Samuel at Ramah; 5and they said to him, 'Behold, you have grown old, and your sons do not walk in your ways. Now appoint a king for us to judge us like all the nations.' 6But the thing was displeasing in the sight of Samuel when they said, 'Give us a king to judge us.' And Samuel prayed to the LORD. 7The LORD said to Samuel, 'Listen to the voice of the people in regard to all that they say to you, for they have not rejected you, but they have rejected Me from being king over them.'"
This request does not appear to ever be condemned in Scripture. In the Book of Deuteronomy, we read:
Deuteronomy 17:14-15: "When you enter the land which the LORD your God gives you, and you possess it and live in it, and you say, ‘I will set a king over me like all the nations who are around me,’ 15you shall surely set a king over you whom the LORD your God chooses, one from among your countrymen you shall set as king over yourselves"
Asking for a king was something foreseen by God. However, Israel is denounced as having sinned for doing so:
1 Samuel 12:19-20: "Then all the people said to Samuel, 'Pray for your servants to the LORD your God, so that we may not die, for we have added to all our sins this evil by asking for ourselves a king.' 20Samuel said to the people, 'Do not fear. You have committed all this evil, yet do not turn aside from following the LORD, but serve the LORD with all your heart" (emphasis added).
A king had to be chosen eventually since David would be a type of Christ. Therefore, why was it considered "evil" for the people to request one in 1 Samuel 12?