Good point!
I tend to think of the time value of money, loosely speaking "opportunity cost", as a sort of risk (the risk that you needed the money right now to go do something else with it), but that's a pretty idiosyncratic way to think about it, really.
Much more fundamentally, it is a mechanism for moving things around -- tangible capital like tools and buildings. Interest is in part a payment for risk of default, but it is also payment for use of capital (the debtor gets to use it, the creditor gives up his ability to use it). There would still be interest even if there were no risk at all.