Let's do the apologetics dance: That part of the bible was metaphorical; you're taking it out of context; that was the old covenant which was abolished when Jesus died on the cross (except for the ten commandments and the part about gays being an abomination); you're not reading those passages correctly; there was a different translation for some of the words in those passages which mean something else.
Christian apologetics is the art of rolling a dog turd in sugar and selling it as a donut.