Then they asked for a king, and God gave them Saul the son of Kish, a man of the tribe of Benjamin, for forty years.
Acts 13:21 ESV

Wrong tribe, wrong king, but God gave it to them. The people asked wrongly, so God gave them wrongly, just as James wrote: "You receive not, because you ask amiss."