The law of Deuteronomy 21:10-14 says that:
"You may go to her, cohabit with her, and she shall be your woman.
But if you do not desire her later, you must set her free. You may not
sell her for money, nor make her your slave, because you humbled her.”
The Talmud explains that this law is not an ideal, but is a concession to the human passion. Rashi seems to say that based on halakhah, an Israelite soldier may even marry a Canaanite woman, tho the Talmud is clear that the child will not be considered his own. This is why when King David had four hundred children as a result of the law of a captive woman, none were considered his own and so they could not compete with Solomon for kingship.
We could apply the same to the laws of slavery, for example. Yes, the Torah "allowed" slavery but restricted the treatment of slaves. The Rambam wrote that people were to treat their slaves fairly, well, and with respect. Similarly, Maimonides seems to say that G-d does not need or want sacrifices. But since it is, as Maimonides wrote, “impossible (for an individual or nation) to go suddenly from one extreme to another; it is…impossible for him to suddenly discontinue everything to which he has been accustomed.” Thus, G-d “allowed” the ancient Israelites to have them as a concession, a concession to the primitive nature of human beings. Maimonides wrote that there seems to be a law of nature of the principles of gradual development. Things develop gradually. Just as flowers sprouts in stages or steps and not by leaps, so do the Jewish people develop spiritually. The Rambam explains:
“He did not command us to give up and to discontinue all these manners
of service; for to obey such a commandment it would have been contrary
to the nature of man, who generally cleaves to that to which he is
used; it would in those days have made the same impression as a
prophet would make at present if he called us to the service of G-d
and told us in His name, that we should not pray to Him, not fast, not
seek His help in time of trouble; that we should serve Him in thought,
not by any action. For this reason G-d allowed these kinds of service
to continue.” (Guide,3:32 from the easy to read M. Friedlander
Now, why does the law allow these actions but not consuming a bacon-cheeseburger? The simple answer is that bacon-cheeseburgers did not exist in biblical times. Or, we could say that the passions for sex are much stronger than food. I was once told about a poll that said that people would rather give up food than sex. Or, perhaps we could say that the Torah laws are based partly on the time, place, and people for which it was given. This is why Rabbi Ishmael said that “the Torah (which is intended for humans) speaks in human language.”
It is also the opinion of the highly respected expert on Maimonides, professors Menachem Kellner, who holds an interesting position of halakhah. He says that according to Maimonides, the biblical laws are arbitrary (ie it could have been other than it is). Because the Torah was given to Abraham's descendants (Abraham being the man who rediscovered G-d), it follows that the Torah could have been different. Thus halakhah is a social reality but not an ontological reality. For example, Rambam writes that the laws of sacrifices were a concession for the primitive nature of human beings. In fact, most of the mitzvot were given to wean Jews away from idolatry. Rambam writes that many commands are linked to Sabian idolaters, but that the Torah refines, restricts, or gives new meaning to these practices. As an example, Kellner points to native Americans. Had Abraham been a Navajo, for example, the Torah would reflect their history and there would be no laws concerning sacrifices, for example, since the Navajo did not practice sacrifices.