Why is eved ivri the first mishpat that Moshe Rabeinu is told to present to B'nei Yisrael? The Ramban (Sh'mot 21:2) is worth reading in regard to this question. He explains that because this mishpat brings to mind a number of fundamental ideas, such as yitziat Mitzrayim and ma'asei b'reishit, it should come first (this is somewhat of an oversimplification of Ramban's peirush).
However, the Torah's presentation is still somewhat difficult. Let us consider the position that B'nei Yisrael were in. They had just been freed from slavery in Mitzrayim. Was it not insensitive to begin the presentation of the mishpatim with a discussion of the proper treatment of an eved ivri? Did not Hashem just reveal himself to B'nei Yisrael at Har Sinai with the following words:
"אָנֹכִי ה' אֱלֹקיךָ, אֲשֶׁר הוֹצֵאתִיךָ מֵאֶרֶץ מִצְרַיִם מִבֵּית עֲבָדִים" - "I am Hashem, your G', who took you out of the Land of Egypt, from the beit avadim [house of slavery]."?
I believe that there was a great need to begin with this mishpat. Often, when a people overcomes some great oppression they develop a reactionary position. For example, after the American Revolution (1776) the revolutionaries set up a weak confederacy of states because they were afraid of the abuses that could result from a strong federal government. However, this situation was intolerable and they found it necessary to establish a stronger union that reasonably balanced state and federal powers. This was accomplished on June 21, 1788 when The United States Constitution was ratified.
B'nei Yisrael were in a similar circumstance. They had experienced great oppression under the hand of the Mitzrim. Their natural reaction would have been to abolish slavery altogether. However, this would not have been a balanced approach. There are certain cases where slavery, even of one's brethren, can be good. Specifically, the two cases in which the Torah permits eved ivri: 1) the thief who does not have enough money to make restitution; 2) the poor man who has nothing. For these individuals the mishpat of eved ivri is a kind of rehabilitation (ואכמ"ל).
I feel that one last thing must be made clear. An eved ivri is not an eved in the normal sense of the word. I quote Rambam (Mishne Torah, Hilchot Avadim, 1:9) as just one illustration of this point:
כל עבד עברי או אמה עברייה--חייב האדון להשוותן אליו במאכל ובמשקה בכסות ובמדור, שנאמר "כי טוב לו עימך" (דברים טו,טז): שלא תהיה אתה אוכל פת נקייה והוא אוכל פת קיבר, אתה שותה יין ישן והוא שותה יין חדש, אתה ישן על גבי מוכין והוא ישן על גבי התבן, אתה דר בכרך והוא דר בכפר או אתה בכפר והוא בכרך--שנאמר "ויצא, מעימך" (ויקרא כה,מא). מכאן אמרו חכמים כל הקונה עבד עברי, כקונה אדון לעצמו.
An eved ivri or amah ivriya -- their master is required to treat them equally to himself in regard to: food, drink, clothing and lodging, as it says, "and it shall be good for him with you"(D'varim 15:16). It should not be that you are eating bread made from fine flour and he eats bread made from coarse flour; you drink old wine and he drinks new wine; you sleep on cotton and he sleeps on straw; you dwell in a city and he dwells in a village... Based on this the Chakhamim say, "Anyone who acquires an eved ivri - it is as if he acquired a master for himself."