The reason for this is that lenders want to get back an amount of money that is at least as valuable as what they originally lent, plus something extra to compensate them for lending. If the interest rate is not high enough, the money that they get when the loan comes due will not be worth that much.
Think about it this way. If someone lends $100 at 5% interest for one year, they will get $105 at the end of the year. But what if the rate of inflation is 7%? To get money that's as valuable as the $100 that they lent, they would have to get back $107. If they only charge 5% and get back $105, they are actually losing value because they lent the money.
For this reason, the higher the rate of inflation goes, the higher interest rates go. If interest rates did not go up, lenders might actually lose money (in real terms) when they lend.