Moses wanted the Israelis to enjoy the Blessings of God and avoid Suffering so he commanded them to Obey the Lord.
This was a Political, Social edict for the betterment of their Society. We need such a leader as Moses in our Secular Government.