(Exodus 21:4) "If his master gives him a wife." Is this permission, or is it perhaps an obligation? Scripture teaches, saying, "If he comes in by himself, etc." (Exodus 21:3) - permission and not obligation; these are the words of Rabbi Ishmael. "If his master gives him a wife" - one who is designated for him, so that she should not be like an ownerless maidservant. "If his master gives him a wife" - Scripture speaks of a Canaanite maidservant. Or is it perhaps of a Hebrew woman? When it says, "the woman and her children shall belong to her master" (Exodus 21:4), behold, Scripture speaks of a Canaanite maidservant. "And she bears him sons." I have here only sons and daughters; from where do I include one of indeterminate sex and one of double sex? Scripture teaches, saying, "the woman and her children shall belong to her master" - in any case. Rabbi Nathan says: There is no need for Scripture to say "and she bears him," except to include the master who comes upon his maidservant, that her children are slaves.
Whether a Master May Give His Hebrew Servant a Wife
Yalkut Shimoni on Torah 312:1
(שמות כא ד) אִם אֲדֹנָיו יִתֶּן לוֹ אִשָּׁה, רְשׁוּת אוֹ אֵינוֹ אֶלָּא חוֹבָה, תַּלְמוּד לוֹמַר אִם בְּגַפּוֹ יָבֹא וְגוֹ', רְשׁוּת וְלֹא חוֹבָה, דִּבְרֵי רַבִּי יִשְׁמָעֵאל. אִם אֲדֹנָיו יִתֶּן לוֹ אִשָּׁה, שֶׁהִיא מְיֻחֶדֶת לוֹ, שֶׁלֹּא תְּהֵא כְּשִׁפְחַת הֶפְקֵר. אִם אֲדֹנָיו יִתֶּן לוֹ אִשָּׁה, בִּכְנַעֲנִית הַכָּתוּב מְדַבֵּר. אוֹ אֵינוֹ אֶלָּא בְּעִבְרִית, כְּשֶׁהוּא אוֹמֵר הָאִשָּׁה וִילָדֶיהָ תִּהְיֶה לַאדֹנֶיהָ, הֲרֵי בִּכְנַעֲנִית הַכָּתוּב מְדַבֵּר. וְיָלְדָה לּוֹ בָנִים, אֵין לִי אֶלָּא בָּנִים וּבָנוֹת, טוּמְטוּם וְאַנְדְּרוֹגִינוֹס, מִנָּיִן, תַּלְמוּד לוֹמַר, הָאִשָּׁה וִילָדֶיהָ תִּהְיֶה לַאדֹנֶיהָ, מִכָּל מָקוֹם. רַבִּי נָתָן אוֹמֵר, אֵין תַּלְמוּד לוֹמַר וְיָלְדָה לּוֹ, אֶלָּא לְהָבִיא אֶת הָרַב שֶׁבָּא עַל שִׁפְחָתוֹ שֶׁוְּלָדֶיהָ עֲבָדִים.