At a most basic level, the two purposes of the Law are to help turn man from idolatry and help him reorient to the G-d of Israel (and integrate into this family).
Of course, this reorientation process involves many different Biblical commands, each with its own specific rationale (which is in addition to the aforementioned general rationales).
There are two types of commandments, the mishpatim and the chukim. The mishpatim have rationales which are very easily discerned as they contain basic principles of righteous living. The chukim (e.g. kashrut, blood atonement, moedim, etc) also have rationales but we don't always understand them fully. However, we do understand most of them: kashrut law (Lev. 11) is about eating those things designed for human consumption; the laws of Temple purification have a symbolic and inherent significance; the laws of the moedim (appointed times) help us to identify with Israel (e.g. when we taste the bitter herbs of the Passover seder, how can we not identify with the ancient Israelites?) and to learn more about Yeshua and what He accomplished.
In summary, each mitzvah has, in addition to its general rationale, a specific rationale."