1God spoke all these words, saying, 2“I am Yahweh your God, who brought you out of the land of Egypt, out of the house of bondage.
3“You shall have no other gods before me.
4“You shall not make for yourselves an idol, nor any image of anything that is in the heavens above, or that is in the earth beneath, or that is in the water under the earth: 5you shall not bow yourself down to them, nor serve them, for I, Yahweh your God, am a jealous God, visiting the iniquity of the fathers on the children, on the third and on the fourth generation of those who hate me, 6and showing loving kindness to thousands of those who love me and keep my commandments.
7“You shall not misuse the name of Yahweh your God, for Yahweh will not hold him guiltless who misuses his name.
8“Remember the Sabbath day, to keep it holy. 9You shall labor six days, and do all your work, 10but the seventh day is a Sabbath to Yahweh your God. You shall not do any work in it, you, nor your son, nor your daughter, your male servant, nor your female servant, nor your livestock, nor your stranger who is within your gates; 11for in six days Yahweh made heaven and earth, the sea, and all that is in them, and rested the seventh day; therefore Yahweh blessed the Sabbath day, and made it holy.
12“Honor your father and your mother, that your days may be long in the land which Yahweh your God gives you.
13“You shall not murder.
14“You shall not commit adultery.
15“You shall not steal.
16“You shall not give false testimony against your neighbor.
17“You shall not covet your neighbor’s house. You shall not covet your neighbor’s wife, nor his male servant, nor his female servant, nor his ox, nor his donkey, nor anything that is your neighbor’s.”
18All the people perceived the thunderings, the lightnings, the sound of the trumpet, and the mountain smoking. When the people saw it, they trembled, and stayed at a distance. 19They said to Moses, “Speak with us yourself, and we will listen; but don’t let God speak with us, lest we die.”
20Moses said to the people, “Don’t be afraid, for God has come to test you, and that his fear may be before you, that you won’t sin.” 21The people stayed at a distance, and Moses came near to the thick darkness where God was.
22Yahweh said to Moses, “This is what you shall tell the children of Israel: ‘You yourselves have seen that I have talked with you from heaven. 23You shall most certainly not make gods of silver or gods of gold for yourselves to be alongside me. 24You shall make an altar of earth for me, and shall sacrifice on it your burnt offerings and your peace offerings, your sheep and your cattle. In every place where I record my name I will come to you and I will bless you. 25If you make me an altar of stone, you shall not build it of cut stones; for if you lift up your tool on it, you have polluted it. 26You shall not go up by steps to my altar, that your nakedness may not be exposed to it.’
Deut 12:2 "Ye shall utterly destroy (חרם, ḥērem)" -Israel is supposed to be totally separate culture from those around them.
The passage here is much about the centralization of worship in Deuteronomy, and as such a very important topic in academic discussion in Old Testament scholarship for the last 200 years. Without going here into any of the complications and various opinions expressed, according to Deuteronomy’s vision, Israel is to gather together in one place for worship three times a year, and sacrifice their offerings only in that place. In a broader context, this is to happen when the nation has settled in the land and is at peace, and such travelling is possible in practice (Deuteronomy 12:10-11). In other circumstances, one may sacrifice locally (cf. Exodus 20:22-24; cf. Deuteronomy 27; Joshua 8:30-35; note however that, according to Leviticus 17:1-9, during the time in the wilderness, all sacrifices had to be brought to the tent of meeting, the Israelite sanctuary at the time). In a yet broader context, the concern of Deuteronomy, and the Pentateuch and Old Testament as a whole is that the Israelites worship only their God Yahweh. From another angle, as part of the settlement and striving towards purity in life and worship, the indigenous nations and their worship practices are to be eradicated so that no trace is left to lead Israel astray.
In modern thinking, the command in Deuteronomy actually amounts to genocide and is therefore problematic, particularly for those who take a high view of Scripture, and raises the question of theodicy, or the justification of God’s actions. But, if one reads the book of Revelation or even the New Testament as a whole, the apparent concept of damnation to unbelievers is at least arguably in line with the concept of killings of non-Yahwists in the Israelite conquest tradition. The issue at hand here is also perhaps mitigated by the fact that the Israelites did not manage to drive out or kill many of the native inhabitants, and by the fact that the conquest and settlement are to be considered as a one-time non-repeatable set of events.
All this said, as the nations were left in the land, as the Bible describes, the Israelites started to follow their practices (see the book of Judges in particular). These points considered, for Christians the passage can be read to promote fleeing away from idolatry and from any practices that are contrary to good Christian ethical principles, in line with New Testament material (cf. 1 Corinthians 10:14). The New Testament also seems to ask Christians to think of whom they associate with (1 Corinthians 15:33), and yet, this does not mean that one cannot associate with those who are not Christian (1 Corinthians 5:9-11). Jesus himself associated with all, and the Pharisees who criticised him for that are described as hypocrites by the New Testament (see e.g. Matthew 9:9-13, 22:18, note also that Paul in 1 Corinthians 15:33 might be quoting a popular proverb of the time). So, great wisdom and humility is required of Christians in following God with joy and ethical verve, while at the same time refraining from dubious practices without becoming haughty, condescending, or even violent towards others.