Sounds right but another big factor is to get some predictability.
Demand for mortgage varies over time, regulations change. It's a long term product, banks like to know with high certainty that when someone signs up it will be X earned over a period, not maybe X minus we don't know over an unknown period.
They are in the business of capital efficiency. Lack of control makes capital less efficient, or at least more expensive to keep efficient.
Overpayments (in the UK) are often not allowed, when they are, the borrower needs to arrange it when the loan is taken, and for a fee.
Refinancing is a right, but the fine prints told borrowers at what penalty.