Deuteronomy 4:5 (ESV)

5 See, I have taught you statutes and rules, as the LORD my God commanded me, that you should do them in the land that you are entering to take possession of it.

The Lord called Moses to teach the law for the fundamental reason that Israel would know how to live in the Promised Land.