Hidden within the 72 mitzvot that Maimonides counts in Parashat Ki Tetzei is a commandment which highlights the two different styles of lawgiving. The Torah is made up of aggadah, the homiletic part of our literature, and halachah, the legalistic.
Here, however, we appear to have an example of the halachah contradicting the aggadic paradigm. We are told that the order in which one's sons are born is not something that can be altered to favour a more loved wife, which could change the course of history.
A literal reading makes for a very narrow understanding of the law but avoids any contradiction with the generations of the Genesis narrative. It does not explicitly say that the son cannot sell his birthright, as Esau did; or that a father cannot deny his son his birthright for other reasons, like Jacob did to Reuben.
To make Deuteronomy a true synopsis, this law should be read with as wide a scope as possible. It is not just Moses reminding the children of Israel how to behave in the Promised Land but a message to every generation to learn from our past experiences.
We are the descendants of Jacob rather than Esau, or Isaac rather than Ishmael, yet perhaps this law reminds us too that the mistreatment of one son can poison relationships in future generations and that there is never a legitimate reason to disinherit one's child.