The covenant at mt. Sinai was a marriage covenant between God and the nation of israel. Israel was unfaithful to God and the requirements of the marriage covenant. Eventually God divorced and cast out the northern kingdom called Ephraim or israel while maintaining the covenant with the southern kingdom judah and benjamin. Jeremiah 3:6-10. God said that He would bring the northern kingdom into union with Himself again though. hosea 2:23; romans 9:25.
According to His law a covenant is legally binding until the death of the testator. God's marriage to the the nation of israel is a legal covenant. In order for Him to remarry a divorcee her husband had to die. Jesus said He came for the lost sheep of the house of israel (not judah and benjamin; they were still in covenant) matthew 15:24. Jesus died for the sins of the adulterous northern kingdom but also to open the way for restoration of the northern kingdom into marital union with God. Ezekiel 37:16-19. Hebrew 9:13-18.
To bring legalities into focus...if Jesus isn't God the Son in flesh, He is breaking the law of God by betrothing a divorcee whose husband is still alive. According to God's law both Jesus and the northern kingdom would be stoned to death for their adulterous relationship.
Jesus did everything by "the book"...Revelation 19:6-9