If banks create money out of nothing, and loans create deposits, then why do banks pay interest to depositors?

TLDR; because the central bank sets their deposit rate above zero.

The Gory Details

Let’s say we have Bank A and Bank B. Bank A makes a loan to person D who pays the created deposit to person C for some activity or other. Bank A chooses not to pay interest on the deposit to maximise its profit on the loan.

The intial position looks like this:

Initial loan

Now let’s introduce some competition in the form of Bank B. Bank B thinks it can make money by selling insurance and gimmicks to customers, so it offers 3% on deposits which causes person C to move their account to Bank B.

Now for money to move between banks, the destination bank ends up as the depositor in the source bank. This is the position after clearing:

Initial loan

This transfer process is called inter-bank lending or is part of wholesale deposits depending upon the context of the discussions.

Now it is bank B that is getting nothing on its deposit, while paying out 3% to customer C. If their plan to sell insurance and other gimmicks at 85% profit margins gets hit by yet another misselling scandal they are in big trouble.

Fortunately bank B has an alternative that person C does not. They can move their deposit to the central bank. And this central bank is paying a support rate of 5%

Now if bank B did this it would get 5% on its deposit, pay out 3% to person C and pocket a cool 2% profit - and all without doing any actual bank lending to the economy at all.

Bank A on the other hand would be out of balance and forced to borrow from the central bank at the penalty rate (i.e > 5%).

If it were to happen the position would look like this:

initial loan

To avoid this happening, bank A is forced to pay interest on its deposits at an amount so that bank B will deposit with them rather than the central bank (ie more than 5%). Or it could outbid bank B and attract the retail depositor back - which then drives savings rates up towards 5% and beyond if bank B really thinks its gimmicks are a moneyspinner.

And that’s how central bank interest rates bind on the banking market, why deposits receive interest and why retail deposits often pay more than the base rate.