David was all you say he was and more. Yet, God so loved him, that he won his battles, had his wives, and he's talked of, more than any one, God exempted, in the original Bible, which ends at The Book of Daniel.
He also chose him to be the sire of the future Messiah. Something in what he was doing was definitely alright with The Lord.
Whatever his relationship with Johnathan, and have taken it for a long time that it had a highly reasonable chance of being homosexual, it did not bother God, so why should it you.