In Allah’s law it is not. He received a great reward and Allah will compensate him. It’s just like when we pay Zakat or Khums. Technically we are losing money but it’s not injustice. Allah wants us to help those in need, and so the same applies to a loan.