It's Iranian money not US taxpayer money. And it was part of the deal to free American hostages held in Iran.
Here's the story. This is from the AP from 8/12/23:
The United States and Iran reached a tentative agreement this week that will eventually see five detained Americans in Iran and an unknown number of Iranians imprisoned in the U.S. released from custody after billions of dollars in frozen Iranian assets are transferred from banks in South Korea to Qatar.
And specifically:
Under the tentative agreement, the U.S. has given its blessing to South Korea to convert frozen Iranian assets held there from the South Korean currency, the won, to euros.
That money then would be sent to Qatar, a small, energy-rich nation on the Arabian Peninsula that has been a mediator in the talks. The amount from Seoul could be anywhere from $6 billion to $7 billion, depending on exchange rates. The cash represents money South Korea owed Iran — but had not yet paid — for oil purchased before the Trump administration imposed sanctions on such transactions in 2019.
So it's not US taxpayer money at all, is it?. It's money owed to Iran by South Korea for oil purchased more than 4 years ago.
Also:
The U.S. maintains that, once in Qatar, the money will be held in restricted accounts and will only be able to be used for humanitarian goods, such as medicine and food. Those transactions are currently allowed under American sanctions targeting the Islamic Republic over its advancing nuclear program.
This was confirmed by Secretary of State Anthony Blinken on September 18, 2023:
With regard to the resources, I think it’s very important to be very clear about exactly what this involved. As you know, this involved the access by Iran to its own money, money that had accumulated in a Korean bank as the result of oil sales that Iran made, which were lawful at the time those sales were made. And from day one, our sanctions have clearly – and indeed always – exempt the use of resources for humanitarian purposes, because our aim is not to harm the Iranian people. Our problem, our profound problem, is with the Iranian regime. So from day one, these Iranian monies that were in a Korean bank have always been available to Iran to use for humanitarian purposes. But for a lot of technical reasons, they weren’t able to access those funds where they were, so the funds were moved to another bank where we have absolute oversight of how they – how they’re used, and they can only be used for humanitarian purposes.
Also, all of that money is still there in Doha, officials have said.
Any questions?