We don't actually know that a prenup deters temptation.
If it was written properly, it could.It is just as possible that a couple would hit a rough spot in their marriage and the prenup would make divorce seem like a better option.
In Croix's example, assuming that the Church did not authorize a CIVIL divorce for the valid reasons of violence/cheating, then if the spouse who sought the sinful divorce was not rewarded with financial assets, this would no doubt deter one from exiting the marriage for frivolous reasons.
And how does one know at the time of the prenup which spouse will be divorce unjustly and need protection?
Duh, you don't. It would be written equally to the benefit/protection of both spouses.