The first of the Ten Commandments prohibits the worship of false gods. The second prohibits false worship of the true God.
You shall not make for yourself a carved image, or any likeness of anything that is in heaven above, or that is in the earth beneath, or that is in the water under the earth. You shall not bow down to them or serve them, for I the LORD your God am a jealous God, visiting the iniquity of the fathers on the children to the third and the fourth generation of those who hate me, but showing steadfast love to thousands of those who love me and keep my commandments. (Exodus 20:4–6)
God, apart from Jesus–whom the original recipients of the Decalogue did not know, does not have physical dimensions or limitations, so any sculpted or painted artwork intended to depict Him directly is lying. It is a false representation of God so it cannot honor Him. Even though creation points to God, nothing in the ocean, on land, or in the sky can stand in for Him.
God desires exclusive worship and He wants that worship to be pure. He forbids whatever would misrepresent and distract from the revelation of Himself in the Word.
It is interesting that He attaches His own jealous character as a reason for this commandment rather than to idolatry. Those who claim to worship Him alone but who worship Him according to their own imaginations will be punished generationally. Certainly this applied to Israel, but Peter’s description of “futile ways inherited from your forefathers” (1 Peter 1:18) seems related. Error propagates. Error about God is itself one of the judgments on those who hate God.
On the other hand, God spreads blessing over and through those who love Him. Well beyond three or four generations, His steadfast love extends “to thousands.” Our obedience to His commandments starts with undivided and undistracted worship in spirit and truth.