To be legal, a contract must have a legal purpose. This means that the object of the contract and the reason the parties enter into the agreement must be legal. A contract in which one party agrees to commit murder for money would be unenforceable in a court of law because the object or purpose of the contract is not legal. In all jurisdictions, insurance is considered to possess a legal purpose.
Humanity is at odds with God because humanity has been tainted by sin, and God cannot tolerate sin (Psalm 7:11, Habakkuk 1:13). People must be reconciled to God through the satisfaction of the demands of his justice provided by Christ’s atonement (Romans 5:10). There is a divine proviso attached to the forgiveness of sins. Every just judge must uphold the law. God is a just judge, and it would be a violation of God’s righteous character — cosmically illegal, as it were — for him to pardon sinful people, apart from either their own atonement or through an acceptable vicarious atonement (Leviticus 17:11, Hebrews 9:15-22). Since the former option is obviously impossible, the latter option is the only viable option.
Since fallen humanity cannot reach God, the Cross must bridge the gulf between a holy God and his estranged people (Zechariah 9:11, John 14:6, Hebrews 10:19-22).
God’s sovereign and righteous purpose in coming into covenant with human beings is to save a people for himself (Exodus 18:10, 24:6-8, Deuteronomy 7:6-8, Jeremiah 31:31-34, 32:38-40, Matthew 26:28, Hebrews 12:23-24, Revelation 21:3).