At Mount Sinan, God gave to Moses his Torah. The Torah literally means “teaching”, not “law” as commonly thought. It was to be the Constitution of the soon-to-be-formed nation, much like the American Declaration of Independence which spelled out what this newly formed nation would look like.
In Exodus 19:9 (and again in 20:1), we read that when Moses had ascended the mountain upon God’s invitation, God gave Moses the “words”, or dabar in Hebrew. The other word that is used to refer to what God gave to Moses on the mount is “judgements”, or mishpat (Ex 24:3). It conveys an image of God making a decision in a case, judging between right and wrong. They were not even call the Torah, and definitely not the Law.
What was the purpose of the Torah? Well, I can think of a few reasons why God gave it to the children of Israel.
1. To take Egypt out of them.
God had just delivered His people out of Egypt “with a strong hand”. That, as you would agree, was the easy part. The hard part was to take Egypt out of these people. After 430 years of immersion into the Egyptian culture, the Israelites had become more Egyptian and Hebrews. From Joshua 24:14, we learn that they had even embraced the worship of Egyptian gods. What was stressed again and again in the Torah was the concept of monotheism, that the God of Israel is one (Deut 6:4).
In In the Beginning…We Misunderstood, Johnny Miller and John Soden showed that the Creation account in Genesis chapter 1 was not written scientifically or chronologically, but theologically. It was to replace the Egyptian cosmogony, with which the Israelites had been indoctrinated.
In the Torah, God made clear what He considered acceptable and unacceptable. This pertains to the practices the Israelites were accustomed to while they were in Egypt.
2. To make them into a kingdom of priests and a holy nation.
God’s plan for the children of Israel from the beginning has been to make them into a “kingdom of priests and a holy nation”. But this was not going to happen overnight. Just as someone who is married into the royal family would need to be trained and groomed to eat, sit, walk, talk and think like royalty, Israel would have to undergo a ‘conversion’ course as well. The Torah was their training manual.
In Deuteronomy 28, Moses reminds the people that if they would obey all the commandments of God, they would by blessed by God in all ways. Among which, one of them is that they would be the head and not the tail, they shall lend to many nations and not borrow (Deut 28:12, 13).
In Babylon, Daniel and his three Hebrew friends were already standing out from the crowd on account of their intelligence. They had “aptitude for every kind of learning, well informed, quick to understand, and (was) qualified to serve in the king’s palace” (Daniel 1:4). As a result, they were selected to be part of an elite group of people who would be taught “the language and literature of the Babylonians”. One of the benefits they got to enjoy was to eat “food and wine from the king’s table”. But Daniel and his friends knew that eating those food would be violating the food laws given by God (Please see my post Did Daniel fast?). So they asked to abstain from them. “At the end of the ten days they looked healthier and better nourished than any of the young men who ate the royal food” (verse 15). This is a classic example of what happens when you obey God’s commandments.
As (a kingdom of) priests, Israel must first learn to worship God in the right way, the way He wants to be worshipped. Thus, the elaborate and detailed instructions for the worship of God. Some times it seems that God is making it hard for the worshipper to draw near to worship Him. On the contrary, God is showing the worshipper the obstacles that might hinder his full and acceptable worship, namely his own sins.
Many mistaken that the rituals prescribed for the common Israelite was the form of worship. It isn’t. God is not interested in the form. He is interested in our faith. For without faith it is impossible to please God (Heb 11:6). The complexity of the ritual sought to impress on the worshipper the severity of sin, so that he would not treat sin lightly but have the fear of God.
Modern day Christians do not have the fear of God. If they have the fear of God, it would probably be the wrong kind of fear. The true fear of God will cause you to avoid sin. With a lack of the fear of God and a light view of sin, Christians today are preaching an ‘easy’ gospel. “Just believe in Jesus Christ, and you will go to heaven.”
Matt Slick asserts that “a true presentation of the gospel includes God, Law and Gospel”. The basics of the gospel message might be presented like this:
God is perfect and holy and He requires nothing less than His own perfection. But, we are not able to attain His holiness. He doesn’t lie, cheat, or steal, but we do these things. Therefore, there’s a judgment upon us because we have broken the Law of God, we have sinned by lying and cheating and stealing. This judgment is eternal damnation. However, God the Father loves us so much that He sent God the Son, Jesus, who died on the cross as a sacrifice to pay the penalty for our sins. He died on the cross and physically rose from the dead three days later. This proves that His sacrifice was acceptable to the Father. Therefore, if you want to receive what Jesus has done to remove the wrath of God the Father, then you must receive Him and His sacrifice by faith. Would you like to pray and ask Jesus to forgive your sins against God? 
God is a holy God, and His standards are absolute. The commandments given in the Torah are just that, commandments. They are not suggestions or recommendations. They are to be absolutely obeyed. Only then would God’s people be “a holy nation”.
3. To lead them to Christ.
Paul, in Galatians 3:24, states that the law served as a tutor to bring His people to Christ, that they might be justified by faith. We know, for example, the Feast of Passover speaks loudly about Christ who would become the Lamb of God sacrificed to take away the sins of the world (John 1:29 and 1 John 3:5). For those who believe in the Lord Jesus, there is no longer a need the Torah to be their tutor. The Torah will continue to take Egypt out of them and make them into a kingdom of priests and a holy nation.
 Matt Slick, How do you present the Gospel properly? http://carm.org/how-to-present-gospel-properly