As Theologians are divided on the question whether the actions of God are the result of His wisdom, or only of His will without being intended for any purpose whatever, so they are also divided as regards the object of the commandments which God gave us. Some of them hold that the commandments have no object at all; and are only dictated by the win of God. Others are of opinion that all commandments and prohibitions are dictated by His wisdom and serve a certain aim; consequently there is a reason for each one of the precepts: they are enjoined because they are useful. All of us, the common people as well as the scholars, believe that there is a reason for every precept, although there are commandments the reason of which is unknown to us, and in which the ways of God's wisdom are incomprehensible. This view is distinctly expressed in Scripture; comp. "righteous statutes and judgments" (Deut. iv. 8); "the judgments of the Lord are true, and righteous altogether" (Ps. xix. 10). There are commandments which are called ḥuḳḳim, "ordinances," like the prohibition of wearing garments of wool and linen (sha‘atnez), boiling meat and milk together, and the sending of the goat [into the wilderness on the Day of Atonement]. Our Sages use in reference to them phrases like the following: "These are things which I have fully ordained for thee: and you dare not criticize them"; "Your evil inclination is turned against them"; and "non-Jews find them strange." But our Sages generally do not think that such precepts have no cause whatever, and serve no purpose; for this would lead us to assume that God's actions are purposeless. On the contrary, they hold that even these ordinances have a cause, and are certainly intended for some use, although it is not known to us; owing either to the deficiency of our knowledge or the weakness of our intellect. Consequently there is a cause for every commandment: every positive or negative precept serves a useful object; in some cases the usefulness is evident, e.g., the prohibition of murder and theft; in others the usefulness is not so evident, e.g., the prohibition of enjoying the fruit of a tree in the first three years (Lev. xix. 73), or of a vineyard in which other seeds have been growing (Deut. xxii. 9). Those commandments, whose object is generally evident, are called "judgments" (mishpatim); those whose object is not generally clear are called "ordinances" (ḥuḳḳim). Thus they say [in reference to the words of Moses]: Ki lo dabar rek hu mi-kem (lit." for it is not a vain thing for you, "Deut. xxxii. 74); "It is not in vain, and if it is in vain, it is only so through you." That is to say, the giving of these commandments is not a vain thing and without any useful object; and if it appears so to you in any commandment, it is owing to the deficiency in your comprehension. You certainly know the famous saying that Solomon knew the reason for all commandments except that of the "red heifer." Our Sages also said that God concealed the causes of commandments, lest people should despise them, as Solomon did in respect to three commandments, the reason for which is clearly stated. In this sense they always speak; and Scriptural texts support the idea.
...The repeated assertion of our Sages that there are reasons for all commandments, and the tradition that Solomon knew them, refer to the general purpose of the commandments, and not to the object of every detail. This being the case, I find it convenient to divide the six hundred and thirteen precepts into classes: each class will include many precepts of the same kind, or related to each other by their character. I will [first] explain the reason of each class, and show its undoubted and undisputed object, and then I shall discuss each commandment in the class, and expound its reason. Only very few will be left unexplained, the reason for which I have been unable to trace unto this day. I have also been able to comprehend in some cases even the object of many of the conditions and details as far as these can be discovered. You will hear all this later on...
Now let us look at the later chapter that we quoted a few days ago:
THERE are persons who find it difficult to give a reason for any of the commandments, and consider it right to assume that the commandments and prohibitions have no rational basis whatever. They are led to adopt this theory by a certain disease in their soul, the existence of which they perceive, but which they are unable to discuss or to describe. For they imagine that these precepts, if they were useful in any respect, and were commanded because of their usefulness, would seem to originate in the thought and reason of some intelligent being. But as things which are not objects of reason and serve no purpose, they would undoubtedly be attributed to God, because no thought of man could have produced them. According to the theory of those weak-minded persons, man is more perfect than his Creator. For what man says or does has a certain object, whilst the actions of God are different; He commands us to do what is of no use to us, and forbids us to do what is harmless. Far be this! On the contrary, the sole object of the Law is to benefit us. Thus we explained the Scriptural passage, "for our good always, that He might preserve us alive, as it is this day" (Deut. vi. 24). Again, "which shall hear all those statutes (ḥuḳḳim), and say, surely this great nation is a wise and understanding people" (ibid. iv. 6). He thus says that even every one of these "statutes" convinces all nations of the wisdom and understanding it includes. But if no reason could be found for these statutes, if they produced no advantage and removed no evil, why then should he who believes in them and follows them be wise, reasonable, and so excellent as to raise the admiration of all nations? But the truth is undoubtedly as we have said, that every one of the six hundred and thirteen precepts serves to inculcate some truth, to remove some erroneous opinion, to establish proper relations in society, to diminish evil, to train in good manners or to warn against bad habits. All this depends on three things: opinions, morals, and social conduct. We do not count words, because precepts, whether positive or negative, if they relate to speech, belong to those precepts which regulate our social conduct, or to those which spread truth, or to those which teach morals. Thus these three principles suffice for assigning a reason for every one of the Divine commandments.
Rambam's view is that chukkim, like mishpatim, serve to "inculcate some truth, to remove some erroneous opinion, to establish proper relations in society, to diminish evil, to train in good manners or to warn against bad habits." The only difference between chukkim and mishpatim is that it is often more difficult to figure out how chukkim do this.