Reza Asgari, an Iranian citizen, was executed last week, Gholamhossein Esmaili was quoted as saying by the judiciary's official website Mizan Online.
He had worked at the defence ministry's aerospace division for years but retired around four years ago, the spokesman added.
Asgari had received large sums of money from the US Central Intelligence Agency "after retirement by selling them the information he had regarding our missiles".
"He was identified, tried, and sentenced to death," Esmaili said.
He added that the death sentence passed for Mahmoud Mousavi Majd, another Iranian who was found guilty of espionage last month, was also set to go ahead.
Majd was accused of spying on Iran's armed forces and helping the US to locate Qassem Soleimani, the top Iranian general killed later in an American drone strike in Baghdad.
Iran retaliated by firing a volley of ballistic missiles at US troops stationed in Iraq, but US President Donald Trump opted against responding militarily.
While the attack on the western Iraqi base of Ain Al Asad left no US soldiers dead, dozens suffered brain trauma.
Iran in February handed down a similar sentence for Amir Rahimpour, another man convicted of spying for the US and conspiring to sell information on Iran's nuclear programme.
Tehran announced in December it had arrested eight people "linked to the CIA" and involved in nationwide street protests that erupted the previous month over a surprise petrol price hike.
It also said in July 2019 that it had dismantled a CIA spy ring, arrested 17 suspects between March 2018 and March 2019 and sentenced some of them to death.
Trump at the time dismissed the claim as "totally false".