Exodus 34:15

Lest thou make a covenant with the inhabitants of the land, and they go a whoring after their gods, and do sacrifice unto their gods, and one call thee, and thou eat of his sacrifice;

The warning belongs to God's renewal of favor to Israel after Moses interceded for the people, when He promised to renew the covenant and to act marvelously on their behalf. It is part of the words of the covenant, the Ten Commandments, which the Lord Himself wrote on the two tables of stone that Moses had prepared and carried to the summit of the mount. They were given after forty days and nights of communion with God in which Moses was miraculously sustained with no one permitted to go up with him. They were held out to Israel as the pledge of reconciliation and the assurance of restored favor, calling guilty Israel to come near even though in conscious guilt under divine displeasure they feared the heavenly light reflected from communion with God.

It is a direct command to remain separate from other nations in order to maintain purity, forbidding making a covenant or mixing and joining with the inhabitants of the land instead of serving the Lord God of Israel with all heart, soul, and mind. The inhabitants of the land mean associations and positions that are accepted but do not glorify God. It demands wholehearted loyalty expressed in keeping His Ten Commandments and His sanctified seventh-day Sabbath, leaving no excuse for becoming careless and indifferent about which day is kept or for keeping the first day of the week.

It specifically forbids forming alliances with heathen nations and sealing the compact by marriage with an idolatrous princess. Solomon violated it by allying with Egypt and marrying Pharaoh's daughter and then by entering into political and commercial alliances with nation after nation, often sealed by marriage with heathen princesses. The hope that an idolatrous wife might be converted is no excuse for the sin, and reasoning that alliances will bring surrounding nations to a knowledge of the true God is carrying out the Lord's purpose in one's own way. Such disobedience rashly disregards wise provisions, sets aside the commands of Jehovah for the customs of surrounding nations, unites strength with the arm of flesh, loses sight of the Source of power and glory, and sets in operation evil forces.