A little looking around, for example, here, seem to indicate that the mortgage products currently on offer in the U.K. are primarily and in principle, at least, a matter of banking custom and practice (i.e. primarily economic decisions made by banks rather than a system mandated by regulators), rather than being mandated in all cases (and porting is not always possible).
But, it also appears that there are regulatory safe harbors and institutional arrangements that make it hard to change that depart from a pure freedom of contract regime.
For example, in the U.K., some loan underwriting standards are mandated by banking regulators who recently made those regulations more strict with the express mandate (ignored by the major banks for the most part) that these standards could not be applied to existing customers porting their mortgages to new properties.
An example of how customary practice can make it hard to change is that, while U.K. law permits fixed rate loans for the 10 to 30 year periods that are common in the U.S., when combined with portability, the economic risk faced by U.K. banks is much greater than in the U.S. where mortgages must be paid off when the property is sold and generally cannot be either assigned to the existing owner or ported with the seller. Because U.S. mortgages generally can't be ported or assumed by new owners, U.S. fixed rate mortgages are paid off, on average, every ten years, even though the home owner could choose to live in the same home and keep the mortgage for thirty years. This limits, in practice, the risk that U.S. banks face when they allow customers to lock into a low thirty year fixed interest rate. (U.S. reformers tend to focus on making loans assumable and limiting the availability of prepayment penalties and wouldn't even dream of trying to establish portable mortgages.)
Similarly, while U.K. law does not require pre-payment penalties, the economic bargain involved in a U.K. mortgage has banks relying on people not pre-paying their loans or paying pre-payment penalties in order to establish the creditworthiness of the bank to regulators and third parties.
So, while it might be possible in theory to allow an assignable version of a U.S. mortgage which is tied to the property and not the person, in the U.K., one would have to simultaneously change other aspects of the transaction and the way that banks estimate their cash flow to meet their own obligations, for this change to work, something that would probably require regulatory cooperation to work in practice.