In establishing His covenant with Israel, God promised them He would have respect unto them, make them fruitful, and multiply them.
God provided Israel with qualities they should desire in a king. In short, when the king ceased to be right with God, he ceased to be right for the people.