Not always. God would even punish them for it.
The Ten Commandments were only 10 of the moral laws of the Hebrews. Jewish tradition holds that there are 613 commandments in total.
From the time of Abraham to Moses, the laws were not formally written down. From the time of Moses up until today, The Torah, (first 5 books of the Bible) contains the 613 commandments that the Hebrews had to follow and that all Jews should follow, in one form or another.
Moses did.
The contract between the Hebrews and their God is known as a covenant. This sacred agreement established a relationship in which God promised to protect and bless the Hebrew people, while they committed to follow His laws and commandments. The most significant covenants in the Hebrew tradition include those with figures such as Noah, Abraham, and Moses, particularly the covenant given at Mount Sinai, which included the Ten Commandments.
The ancient Hebrews' laws of God are collectively called the Torah. The Torah contains the Ten Commandments (Exodus ch.20) as well as some six hundred additional laws and commands, in addition to its historical and other narratives. See also:More detailAbout the TorahThe Ten Commandments
Hebrews believed that god had revealed the laws (ten commandments) to Moses theredy making a promise with them.
The ten commandments
The Torah teaches us that they were the first commandments given to the People from God.
they believed that god would protect them.
their wicked waysProphets scolded the Hebrews about their wicked ways, such as marrying people that weren't of the same religion, falling into idol worship and forgetting Gods commandments.
No, the Sumerians and Babylonians did not follow the Ten Commandments. However they had their own moral values, taught by their own religion.
They made a pact with God to follow the entire Torah, including the Ten Commandments.