To God, idolatry and Sabbath-breaking go hand in hand. Sabbath-breaking is shown to be idolatry because the Israelites were either using it in idolatrous devotion to a false god or not keeping it at all.
The Sabbath was given so that Israel would know the true God, so that they could fulfill their purpose, which was to witness for God before the world, learn more of His purpose, and work to build character so that they could inherit God's Kingdom. They failed miserably and totally.
God accomplished His goal of bringing them into their own land only to uphold the reputation of His name. But what was the overall result? The Israelites in the wilderness died there (Hebrews 3:16—4:2). Their descendants failed in the same manner, so God cut them off and sent them into captivity and slavery.
Israel's history reveals that the Creator God is the Source of the Sabbath, and God's children have the responsibility to honor Him by keeping it.
John W. Ritenbaugh
The Fourth Commandment