It was indeed a hard-hearted people (see Matthew 19:8 and Mark 10:5) to whom God gave these rules. The Holy Spirit in our day has a deeper message, because of the finished work of Christ, and divorce could not now be justified among Christians on such grounds as those of this chapter.
If the people were hard of heart, God was not like them, and the greater part of this chapter speaks in kindness of the poor and defenseless, whether it were one’s brother or a hired servant, or a stranger, or an orphan, or a widow.
“Thou shalt remember,” not how great thou art, or anything of the kind, but “that thou wast a bondman in Egypt, and the Lord thy God redeemed thee thence.” (verse 18)
If you are a believer in the Lord Jesus, dear reader, do you remember often enough that you were a slave of that cruel tyrant Satan until God, in Christ, redeemed you? Turn to Ephesians 2:1-9, and read that wonderful statement, true of everyone who trusts in Jesus.