"His master shall give him a wife" (Exodus 21:4). One might think he vowed it; Scripture teaches "if" - it is only permission. "His master shall give him a wife" - to include the son. "He shall give him a wife" - Scripture speaks of a Canaanite bondwoman. You say it speaks of a Canaanite bondwoman, but perhaps it speaks only of a freewoman? Scripture teaches, "the wife and her children shall belong to her master" - if she were a freewoman, how could the offspring belong to the master? Another interpretation of "he shall give him": he compels him and he comes to her, and even if he is a priest, who is forbidden a harlot, he gives him a Canaanite bondwoman and he comes to her, and the children are his slaves. Or one might think that even if he has no Israelite wife and children, he is permitted the Canaanite bondwoman; Scripture teaches, "then his wife shall go out with him" - when he has a wife and children with him, the master gives him the bondwoman, but if not, he may not. Another interpretation of "he shall give him a wife": one he gives, but he does not give him two wives. One might think he may not give a freeman two wives; Scripture teaches, "his master shall give him a wife" - to him he does not give two wives, but to a freeman he may give two wives. One might think he may give one wife to two; Scripture teaches, "his master shall give him a wife" - one wife he gives him, but not one wife to two. One might think he may not give his Canaanite slaves one bondwoman for two; Scripture teaches, "his master shall give him a wife" - to him he does not give one bondwoman for two, but to his Canaanite slaves he may give one bondwoman for two. "And she bears him sons or daughters" - it likens son to daughter: just as the daughter has no betrothal upon a freeman and does not leave him by a writ of divorce, so too the son has no betrothal upon a freewoman and does not leave her by a writ of divorce. "The wife and her children" - all the children she bears, whether from him or from another place, are slaves. "Shall belong to her master" - teaching that she goes out without a writ of divorce. Another interpretation of "the wife and her children shall belong to her master": one might think that if the master wished to sell his wife and children while he is still under him, he could prevent it by his own hand; Scripture teaches, "the wife and her children shall belong to her master." "And he shall go out by himself" - to include for him many forms of going out: by years, by Jubilee, by deduction of money, by document, and by the death of the master without a son.
When the Master Gives the Servant a Wife and Her Children Remain
Mekhilta DeRabbi Shimon Ben Yochai 21:4
אדניו יתן לו אשה יכול נדרה ת״ל אם אינו אלא רשות: אדניו יתן לו אשה. לרבות את הבן: יתן לו אשה. בשפחה כנענית הכתוב מדבר אתה אומר בשפחה כנענית הכתוב מדבר או אינו מדבר אלא בבת חירין ת"ל האשה וילדיה תהיה לאדוניה אם בת חורין היאך ולדות לבעל: ד"א יתן לו כופה אותו ויבא עליה ואפלו היה כהן שהוא אסור בזונה נותן לו שפחה כנענית ויבוא עליה והבנים עבדם או יכול אפילו אין לו אשה ובנים מישראל הרי הוא מותר בשפחה כנענית ת"ל ויצאה אשתו עמו בזמן שעמו אשה ובנים הוא נותן לו שפחה ואם לאו אינו יכול: ד"א יתן לו אשה אחת נותן ואינו נותן לו שתי נשים יכול לא יתן לבן חורין שתי נשים ת"ל אדניו יתן לו אשה לו אין נותן שתי נשים נותן הוא לבן חורין שתי נשים יכול יתן אשה אחת לשנים כדרך שנותן לעבדיו הכנענים שפחה אחת לשנים ת"ל אדניו יתן לו אשה אשה אחת נותן לו ואין אשה אחת לשנים יכול לא יתן לעבדיו הכנענים שפחה אחת לשנים ת"ל אדניו יתן לו אשה לו אין נותן שפחה אחת לשנים נותן הוא לעבדיו הכנעניים שפחה אחת לשנים: וילדה לו בנים או בנות. מקיש בן לבת מה הבת אין לה קידושין על בן חורין ואין יוצאה הימנו בגט אף הבן אין לו קידושין על בת חורין ואין יוצאה הימנו בגט: האשה וילדיה. כל בנים שיולדת בין ממנו בין ממקום (אחת) [אחי] הרי אלו עבדים: תהיה לאדוניה. מלמד שיוצאה בלא גט: ד"א האשה וילדה תהיה לאדוניה יכול אם רצה רבו למכור אשתו ובניו כשהוא תחתיו יכול הוא לעכב על ידיו ת"ל האשה וילדיה תהיה לאדוניה: והוא יצא בגפו. לרבות לו יציאות הרבה בשנים וביובל ובגרעון כסף ובשטר ובמיתת האדון בלא בן: