Understanding Israel’s 10 Commandments

Are the 10 Commandments really a moral code, or did the ancients understand them rather as the constitutional basis of a political theocracy?