In the Utah case, Bank of America is trying to force the matter into the Federal court system by claiming that it is now a "securities" issue subject to Federal oversight rather than a "real estate" issue subject to provisions of Utah law.
The irony of all this is that it can be traced all the way back to the infancy of mortgage bonds (then called collateralized mortgage obligations, or CMOs) in the 1970s. Most Wall Street investment banks were very reluctant to get into the business (which is why Salomon Brothers dominated the industry through the mid-1980s) because nobody ever really addressed the issue of whether CMOs were subject to real estate law or securities law. I guess they still haven't!
The contractual relationship is established by the secondary market, otherwise there is no insurance. All of those that play the buying selling of notes, play by the same rules, how else would the millions of homes that are sold and paid off annually have their paid notes show up and cancelled in a timely manner.