If he comes in single, he shall go out single; if he comes in married, then his wife shall go out with him.
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 he came in by himself, he shall go out by himself,.... That is, if he came into his servitude "alone", as the Septuagint version has it, he should go out of it in like manner; the word for "by himself", some interpret with "his garment" (f), or the skirt of one; and then the sense seems to be, that as he was clothed when...
If he came in by himself, he shall go out by himself: if he were married, then his wife shall go out with him. (b) Not having wife nor children.