There are at least two ways to look at this. From the point of view of a bank, the purpose of banking is to make a profit. Banks are companies just like any other, trying to make money. They make money by taking in deposits and lending them out. The interest they charge is a major way of making money.
From the point of view of a society, banking's purpose is to help the economy grow. Banking takes extra money that people have and makes it become productive. It takes our extra money and lends it out to people who can use it for things like opening new businesses. By doing this, banks help our economy.