Apparently you're not aware that God disapproved of the behavior documented.
He disapproved but being forgiving and forebearing and indeed, negotiable (i.e., actually discussed things with people rather than just "this is it!"), allowed even then such sinners to carry on. David was a major sinner, but God still loved him.
Looking at a major aspect of the Bible, God did not approve of kingships. He had institutad judge-oriented governance. But people wanted single kings to fawn over, and He gave in and let them have it.
Your (as well as others') pointing out bad stuff in the Bible is as pointless as the Moslem-defenders pointing out violence such as mass killings and so on. Its existence doesn't CONDONE the action, merely records it. The basic rules were laid out and they simply weren't always followed.
You and I can agree on that. In most times and places, there was one set of sexual "rules" for the people in power, and another set, enforced by religion and the civil law, for the ordinary folks.