Deuteronomy 21:16
Then it shall be, when he maketh his sons to inherit that which he hath, that he may not make the son of the beloved firstborn before the son of the hated, which is indeed the firstborn: Then it shall be, when he maketh his sons to inherit that which he hath, that he may not make the son of the beloved firstborn before the son of the hated, which is indeed the firstborn:
The law containing this verse recognized polygamy as existing under the Mosaic dispensation and placed restrictions upon it rather than abolishing it, and polygamy was in this neither commanded nor encouraged. Regulating such a household does not command, encourage, or institute polygamy as divine, does not make it God's plan, and does not excuse its harms, but recognizes the claims of the wives and children affected by it and protects their rights. The hated wife of the verse is the wife loved less by comparison, for hate here means to love less and not to detest.
When a man with sons by two wives divides his property among his sons in inheritance, he must recognize the actual firstborn even if he is the son of the less-loved wife, and he may not make the younger son of the favored wife the firstborn in his place or transfer the firstborn's inheritance right to him. The firstborn son so protected is entitled to the firstborn's double portion of his father's inheritance, even when he is the son of the less-loved wife. Elisha's request for a double portion of Elijah's spirit refers to this recognized inheritance right, for as Elijah's spiritual son he sought the portion belonging to a firstborn heir.