Here's an article that defends the awarded billions in the Iran Nuclear deal.

https://www.mysanantonio.com/news/article/Was-Obama-s-1-7-billion-cash-deal-with-Iran-12719486.php

Specifically, $400 million in purchased military equipment by Iran was frozen and put in a trust account, pending an decision by the Hague (the U.N.?) in a settlement between the U.S. and Iran over the frozen funds. The argument is that the Hague, based on recent rulings, would have settled against the U.S. requiring an even larger payment to Iran.

But I don't fully buy that, as the case had been pending for almost 40 years in 2016 when the payment was made. But it's at least a legalistic rationalization for the Obama payment, made by a W. Bush era lawyer and security advisor, no less.
But it still doesn't take into account the cost of Iran-sponsored terrorism to the U.S. and other nations over the last 40 years across the Middle East and worldwide. Or that those awarded funds will "likely" go to funding further terrorism.

Borrowing a line from one of my favorite movies, Judgement at Nuremberg: "It may be logical, but it isn't right. And nothing on God's earth could ever make it so."