No contract can cover all eventualities, and only through goodwill and compromise can disputes be avoided when the inevitable happens, and something arises that is not explicitly dealt with in the contract.
"One who marries a woman and agrees that he will support her daughter for five years, he must support her for five years". This seems simple enough. You marry a woman and, while not technically obligated to support her children--that is the responsibility of the father or his heirs--it is something we would naturally expect of the stepfather, especially if the daughter is living with them. But what would happen if this second marriage does not last, as statistics today show is quite likely? Surely one would not expect the husband to support his ex-wife's children from another marriage. Yet so he must do.
"If she marries another and he agrees to support her daughter for five years, the first one may not say, when she comes to me I will support her; rather, he must send her food to wherever she may be. And similarly, the two ("husbands") may not say, we will jointly support her; rather, one feeds her and one sends her the monetary value of the food" (Ketubot 101b).
There is little doubt that had the husband thought his marriage would end in divorce, he would never have agreed to support his stepdaughter when she is no longer such. But in contract law, it is not what one thinks that matters, but rather, what one actually stipulates. Thus, "the smart ones would write, I will feed your daughter for five years on condition that you are with, i.e., married, to me" (Ketubot 102b). The Mishnah continues by teaching that this cycle can continue, so that if this marriage ends in divorce and she marries for a third time (actually it's the third marriage mentioned in the Mishnah, but her fourth marriage), then her current husband would provide the food for the stepdaughter and prior husbands would provide monetary support.
What is fascinating is that while we do not take into account the husband's not thinking through the possibility of divorce, we do alter the actual contract and insist that only one husband gives food and the others give the equivalent in monetary support. As the Talmud notes, "she only has one stomach" (Ketubot 103a), and having two or three (or more!) men provide food would benefit no one, save for the raccoons and garbage collectors who would dispose of the wasted food. Insisting on providing food when there is no need for such--and one can imagine that the ex-husband would spitefully want to do so--borders on Sodomic behavior. With the husband suffering no loss by providing the value of the food instead of food itself, doing otherwise can only be considered spiteful[1].
The Gemara draws a parallel between this case and that of the case of the "rented mill". In that case, Shimon rents Reuven's mill, presumably for his bakery business. Instead of paying rent, Shimon provides Reuven's family with wheat from the mill. Reuven subsequently "becomes wealthy" and purchases a mill to provide for his own needs. Consequently, he demands that Shimon now pay him cash for renting his mill. Provided Shimon has enough clients to keep his mill running at full capacity, he would suffer no loss and Reuven would benefit. To refuse to help others at no cost to oneself is considered behavior fitting for the people of Sedom, and "we force him [not to act] in the ways of Sedom" (Ketubot 103a). One can engage in Sodomic behavior even if one is following his legal obligations to the letter.
Interestingly, no moral censure is expressed towards the mother who, through shrewd negotiating, may have three different men providing support for her daughter. Perhaps our Sages understood that from a parents' perspective, there is no such thing as providing too much for children. Perhaps her past (and at her rate, future) status as a single parent makes such all the more understandable. While there are exceptions, it is more likely than not that we are dealing with a woman who has experienced hardship and possibly poverty. Most importantly, unlike in the case of the mill where the same payment is made in either cash or food, she does stand to gain monetarily from her arrangement.
Outsmarting someone in negotiation is not grounds for censure--though here, too, one may, depending on the circumstances, be expected to act beyond the letter of the law and forego some legal rights. We must always be willing to follow our part in a contract, but oftentimes one is morally[2], if not legally, obligated to waive one's own rights.
[1] This is especially so since it is much easier to send someone a cheque for food than send food itself. I thank Rabbi Jonathan Ziring for this (and many other) insights.
[2] We will, please G-d, discuss this concept of lifnim meshurat hadin in the future.