Generally speaking, the mitzvot are divided into two categories: logical mishpatim ("laws" or "judgements") and supra-rational chukkim ("decrees").
The mishpatim are mitzvot such as the commandment to give charity or the prohibitions against theft and murder, whose reason and utility are obvious to us, and which we would arguably have instituted on our own if G-d had not commanded them. The chukkim are those mitzvot, such as the dietary laws or the laws of family purity, which we accept as divine decrees, despite their incomprehensibility and -- in the most extreme of chukkim -- their irrationality.
[A third category, the eidot ("testimonials"), occupies the middle ground between the decrees and the laws. A testimonial is a mitzvah which commemorates or represents something -- e.g., the commandments to put on tefillin, rest on Shabbat, or eat matzah on Passover. These are laws which we would not have devised on our own, certainly not in the exact manner in which the Torah commands; nevertheless, they are rational acts. Once their significance is explained to us, we can appreciate their import and utility.]
Yet each of these terms -- mishpatim, chukkim and eidot -- is also used by the Torah as a synonym for "mitzvah" and a reference to all commandments of the Torah. A case in point is the Torah section of Mishpatim (Exodus 21-24), which opens with G-ds words to Moses, "And these are the mishpatim that you shall set before them." The 53 mitzvot that follow are indeed primarily logical laws, but they also include a number of "testimonials" and at least one supra-rational "decree" -- the last mitzvah in the series, which is the prohibition against mixing meat with milk ("Do not cook a kid in its mother's milk").
Chassidic teaching explains that every mitzvah is, in essence, a supra-rational chok, and at the same time, every mitzvah is also a comprehensible mishpat.
G-d created the human mind and the logic by which it operates. Obviously, then, it would be nothing less than ridiculous to assume that G-d desires something because it is logical. Rather, the reverse is true: something is logical because G-d desires it. In other words, the reason the commandment "Do not kill" is logical to us is that G-d desired a world in which life is sacred, and molded our minds in accordance with His vision of reality. In essence, however, "Do not kill" is no more logical than the mitzvah of parah adumah (the commandment to sprinkle the ashes of the Red Heifer upon someone who has been ritually contaminated through contact with a corpse -- often cited as the ultimate chok). So the rationality of the commandment "Do not kill" is but an external "garment" behind which lies the mitzvah's essential nature as the supra-rational will of G-d.
In the words of the Tanya: "The rationales of the mitzvot have not been revealed, for they are beyond reason and understanding. Also in those instances in which there has been revealed and explained a certain reason which is apparently comprehensible to us, this is not ... the ultimate reason, for within it is contained an inner, sublime wisdom that is beyond reason and understanding."
On the other hand, even the most irrational decree has its rational elements that can be analyzed by the human mind and appreciated by it as a lesson in life. As Maimonides writes, "Although all the chukkim of the Torah are supra-rational decrees... it is fitting to contemplate them, and whatever can be explained, should be explained."