Deuteronomy 4 — Moses’s Warning Against Idolatry
As Moses concludes his recounting of God’s work with Israel, he admonishes the Israelites, warning them against idolatry:
 “Therefore watch yourselves very carefully. Since you saw no form on the day that the LORD spoke to you at Horeb out of the midst of the fire,  beware lest you act corruptly by making a carved image for yourselves, in the form of any figure, the likeness of male or female,  the likeness of any animal that is on the earth, the likeness of any winged bird that flies in the air,  the likeness of anything that creeps on the ground, the likeness of any fish that is in the water under the earth.  And beware lest you raise your eyes to heaven, and when you see the sun and the moon and the stars, all the host of heaven, you be drawn away and bow down to them and serve them, things that the LORD your God has allotted to all the peoples under the whole heaven.  But the LORD has taken you and brought you out of the iron furnace, out of Egypt, to be a people of his own inheritance, as you are this day.  Furthermore, the LORD was angry with me because of you, and he swore that I should not cross the Jordan, and that I should not enter the good land that the LORD your God is giving you for an inheritance.  For I must die in this land; I must not go over the Jordan. But you shall go over and take possession of that good land.  Take care, lest you forget the covenant of the LORD your God, which he made with you, and make a carved image, the form of anything that the LORD your God has forbidden you.  For the LORD your God is a consuming fire, a jealous God. (ESV)
The primary reason that Moses gives for the commandment against idolatry is that when God came to give the Ten Commandments to Israel, speaking to them out of the fire, the Israelites did not see any form. Hence, for Israel, God had not revealed himself as taking any particular material shape or form, and any attempt to craft a statue to represent God would be idolatry, since that statute would fail to represent God — it would bear false witness against God, because God is not found in creation, but is above creation.
One secondary reason, however, that emerges in verse 19, specifically in relation to the sun, moon, and stars, is that these are “things that the LORD your God has allotted to all the peoples under the whole heaven”. This suggests two things. First, it suggests that the sun, moon, and stars have been given to all peoples and therefore, Israel, as a holy people, cannot worship what is common to all. Second, it provides that these things are allotted to all the people not as gods but as things to be ruled by the people. The failure of idolatry here is in failing to realise the true place of humankind in relation to the created order — to worship the world and the things in it is wrong, not just because it fails to acknowledge God as creator who is not the creation, but also because it fails to give due place to humankind, as God’s vice-regents, to whom have been allotted the things of all creation over which to reign.