Bank do refuse to lend to large segments of the population which can be lent to profitably.
In China, part of the reason is caps on loan interest rates.
But banks in developed countries, like the US and the UK, also fail to serve a large segment of the population. Those underserved by banks have limited options to get loans for emergencies etc., and difficulty building their credit history to gain access to cheaper credit in future.
If you're based in London and are a software engineer or data scientist interested in solving this problem, please email me (personal address in profile) and I can tell you about what we've built so far and what's ahead.