How does lending money contribute to society?
In this simplified hypothetical world, yes, person B could give 100 currency to person A to build the factory directly. But what if person B does not want to take on that risk? How does person B know that person A will be contracted to make 150 worth of goods properly? Person B could just wait to see if someone else finances person A and then buy from A if the factory is successful. A single individual lending, or even small businesses lending out money can be a relatively large amount of money for that entity (so, high risk), whereas banks are able to diversify risks, by making many different loans and spending time evaluating how risky different people are.

Banks take on risk that other people/firms can't afford to or don't want to. Interest rate is very roughly, the price needed to be willing to take on these risks, or more precisely, the rental rate of money.