Financial intermediation is not the same as maturity and risk transformation. A financial intermediary obtains funds from savers, lends them to borrowers (consumers or investors), and charges an intemediation fee or margin. A financial intermediary does not have to perform maturity and risk mismatch. A prudent financial intermediary does not perform maturity or risk mismatch or does it minimally.
Maturity and risk mismatch (or transformation) happens when the assets of an entity, usually a bank or similar, are longer term and riskier than its liabilities: it borrows short and riskless and lends long and riskier. It is the fundamental cause of financial crises. Some financial intermediaries perform maturity and risk mismatch because shorter less risky debt has a lower interest rate than longer riskier debt. Economics is about tradeoffs: an agent cannot perform maturity and risk mismatch and earn higher benefits without becoming more fragile.
Some banks and shadow banks tend to perform maturity and risk mismatch because of cheap central bank refinancing, clumsy regulation and supervision, implicit or explicit guarantees (systemic risk, too big to fail), and deposit insurance (depositors don’t control the banks).
Economic agents prefer to issue long term and risky debt, and hold riskless, short-term assets. This is a particular case of sellers wanting to give low quality at high price and buyers wanting to receive high quality at low price. If sellers sell at high prices and buyers buy at low prices, quality is probably compromised without at least one of the parties knowing it. But the true quality of the product (in this case credit) will show itself with time.
Banks are not only financial intermediaries: they are also payment managers that issue their own liabilities as monetary substitutes; this is the reason why banks can be very leveraged. Maturity and risk matching is performed by prudent fractional reserve banks. It makes no sense for 100% banks.