As much as we don't want to admit it, the Biblical world was not 21st-century western society. The issues are not the same, but the principles are. The fairness and justice of God comes through for each generation and their level of understanding.  Otherwise we would still have slavery.