The love aspect of it does not and should not have to do with the legal aspect. At the end of the day, putting food on the table and a roof over your kids' heads is life's priority, so finding a partner who can assist with that is understandably a prerequisite before any of this love/compatibility stuff can be built on top.
I think it would have saved us both a ton of trouble, misunderstandings, and hurt feelings.
but I'm not sure how much flexibility you have in deciding the (legal) penalties for breaking those informal expectations etc.
I imagine the terms of a marriage contract are defined by each state, as sort of a take-it-or-leave-it contract.
There might be ways to hedge, like prenuptial agreements. However (and not exactly the same thing), I recently spoke with a corporate attorney regarding company protections in the unfortunate case something happened to one of the company founders under various scenarios (e.g. if a company founder gets married and dies within 5 years of incorporation, is there a way to require the spouse to sell those shares back to the company, rather than them owning a controlling stake). Prenuptial agreements were brought-up, and my attorney basically said, "yeah those exist, and are an option, an expensive option, but in a legal battle, pffft, don't expect a prenup to be your pocket ace."
Not really; its sometimes referred to as a contract, but legally the law of contracts doesn't apply either in formation of marriages, or when the expectations associated with marriage are broken.
Marriage is somewhat analogous to a legal partership (especially in common law jurisdictions, where merely behaving as if it existed can cause it to legally exist.)