The numbers in this question are for a developing country, so rates may seem high, but I tried to make them look reasonably related to each other to illustrate this question. The question also assumes "hot" real estate market - where people buy real estate happily and apply for mortgages.
So there's such thing as shared construction agreement. Here's what it is about: a Large Development Company starts construction of an apartment building and individuals who want apartments may throw in their money into this construction before the construction is complete and then once construction is complete they own their apartments as property and can sell/lease them or just live there.
They key is they throw in actual money but they only get a promise of apartments because a lot of things technically can go wrong and it may so happen that construction is paused for long time or the developer even goes bankrupt. They also have to wait before construction completes and so they freeze their money and cannot invest it elsewhere. This is why this shared construction thing bears some investment risk inside.
Risk decreases as construction advances. Prices here are for illustration only. The promise of an apartment may start at $70K USD when there's just a construction site and no equipment yet, then rise to $100K when all the walls are there, then rise to 130K when the construction is technically complete - electricity and elevators are there and working. Then the development company must contact the authorities and formally register parts of the building which turns them into actual apartments and once that happens price can easily reach $150K.
Given the fact that such a building can be crafted and registered in just two years it means that a person can invest $70K and then sell the apartment (assuming it sells) and get $150K which means something like 45% rate of return. Even better, some investors don't wait for completion, instead they sell the promise to someone who wants less risk - they pay $70K when there's just a foundation pit, wait one year until it looks like a building, someone else is willing to pay them $100K to get their right for the future apartment (assuming there are such people). It's still something like 30% rate of return.
Some people don't have the necessary $70K, so they apply for mortgages. A large bank gives them a loan, they invest into shared construction and meanwhile start paying their loan back to the bank. A promise of an apartment to be constructed becomes a collateral.
A mortgage interest rate is 10%. An interest rate when investing into shared construction is about 40%. A large development company with good reputation and transparent enough looks more reliable than a handful of individuals who can just get bored at their jobs and default on their mortgages. It looks like the bank should just invest into construction, wait before construction completes and sell the apartments at $150K. Instead it issues mortgages to individuals at much lower interest rate.
Why would a bank prefer mortgages to individuals at lower rates over direct investment at higher rates?