Commands like this one in Exodus 20 sound strange. What a harsh thing for God to say. If God is invisible, why not have pictures, statues, or images? We are visual creatures after all.
God grounds his reasoning for this command in what he has done for Israel in redeeming her from slavery. This second commandment flows from the first. The Lord gives such commands because he is holy, just, and good. He deserves our respect, love, and obedience not only because he has the “superior firepower,” but because he has created us for love and obedience.
Religions in the Ancient World
In the ancient world religion, magic, and superstition were often intertwined. It was very common to attempt to control a deity through secret names, incantations, and idols. Controlling divine powers, so you could have better crops or a large family, was a primary objective in religion.
The Lord makes the second commandment in this specific context. He cannot be confined by anything or anyone; he cannot be coerced to give grace or love. It was through images and idols that the ancient world sought to control their gods. To make such an image is to do violence to God and his character (Deut. 16:22; Lev. 26:1). That is why creating idols comes with such harsh-sounding punishments (Ps. 97:7). The unique authority and transcendence of God is a proper basis for his commands since he alone can decide how to be worshiped.