David, Solomon, Saul all had flaws, as did many subsequent kings of Israel and Judah.
They were human. The only perfect man got crucified............
They got away with things you and I wouldnt today