If his master gives him a wife and she bears him sons or daughters, the wife and her children shall be her master’s, and he shall go out alone.
God gave Israel laws framed in infinite wisdom and equity, not left to human guessing. These were not arbitrary rules but a Theocracy's constitution, suited to make them happy. The Israelites had suffered under Egyptian cruelty; now that they held power over servants, provision was made to ensure they would not replicate that abuse. Those who have felt the whip themselves have no excuse to wield it.
AI summary
Commenting on Exodus 21:1-11
If his master have given him a wife,.... One of his slaves, a Canaanitish woman, on purpose to beget slaves on her, since all born in his house were his own; this is supposed to be after he was come into his house, and into his service: and she have born him sons or daughters; as she might have born him several of the one...
If his master have given him a wife, and she have born him sons or daughters; the wife and her children shall be her master's, and he shall go out by himself. (c) Till her time of servitude was expired which might be the seventh year or the fiftieth.