D'varim / Deuteronomy 17:15 "You shall set a king over you, one whom the L-rd, your G-d, chooses; from among your brothers, you shall set a king over yourself; you shall not appoint a foreigner over yourself, one who is not your brother."
G-d selected the human Jewish kings of the bible and gave the right to the kingship in perpetuity to King David and his son Solomon.
Sanhedrin 20b and Sotah 41b (Gemara in the Talmud) tell us that we Jews were obligated to appoint a king (it is one of three obligations when we came to the land of Israel). The other two mitzvot were to destroy Amalek; and to build a Mikdash. The Rambam even wrote that the mitzvah of appointing a king precedes and seems to be a prerequisite to the other two mitzvot.
If it is such a positive thing to appoint a king, why did the prophet Shmuel (Samuel) become angry when the people asked for a king (Shmuel Alef / 1 Samuel 8:5)?
Chazal (Radak, Rambam and Ralbag for three) said that Samuel was angry at the way they phrased their request. The people DEMANDED a king -- as if they can command G-d. They should have ASKED G-d to give them a king, not demand that one be appointed. This was disrespectful to G-d.
On top of that they did not ask for a Jewish king, but rather for a king ‘like all the nations."
A Jewish king is NOT like other kings. Thus this was also insulting to G-d.
Remember that non-Jewish kings were often worshiped as gods -- and the Radak says that some people wanted a king to lead them to serve idols – as was done for foreign rulers. . . Jewish humans are not worshiped (not David, Saul, Solomon or some non-king such as Jesus).
When Shmuel / Samuel the prophet anoints the first Jewish king (Shaul / Saul) he says: "And Samuel took the vial of oil, and poured it on his head, and kissed him. And he said, "Indeed, the L-rd has anointed you to be a ruler over His inheritance." Shmuel Alef / Samuel 1 10:1.
The L-rd anointed Saul to be king. G-d anointed Saul, through the Torah dictated method of his anointment with the שֶֽׁמֶן מִשְׁחַת קֹֽדֶשׁ shĕmĕn mish'ḥat kōdĕsh (“anointment-of-holiness oil”)— which is the only oil that can be used to anoint a Jewish king. It is mentioned in Sh'mot / Exodus 30:25 and again in Sh'mot / Exodus 30:31.
Consider Shmuel Alef / 1 Samuel 9:17 "When Samuel saw Saul, HaShem spoke up to him, "This is the man whom I said to you, This one will rule over my people. He will save My people from the hand of the Philistines, for I have looked upon My people, for their cry has come to Me.""
G-d selected Shaul / Saul as king. G-d is the 'king of kings" but you seem to be confusing that with earthly kings. Who ruled Israel before Samuel? Does the name Joshua ring a bell? How about the various Judges? In other words there were always rulers -- and G-d had said there would be an earthly king.
The Jews did not reject G-d as king (He is the eternal king), they simply wanted an earthly king to lead them since the multiple judges had become a fragmented government. There is a similarity in American history. The original form of American government did not have a strong central government and it was failing -- causing the United States to institute a constitution with a president (modern form of "king"), a congress (Sanhedrin) and court (Sanhedrin).
Israel did NOT reject G-d by wanting a human king, but indeed fulfilled what G-d said we would do -- and per our sages were commanded to do.