The Guardian Council, Iran's hard-line constitutional watchdog, rejected Hassan Khomeini's appeal against his bar from standing for election to the Assembly of Experts, a body empowered to select Iran's supreme leader.
The council screens all candidates before allowing them to run.
It said that Khomeini "has not enough Islamic knowledge to distinguish the next Supreme Leader", a family member told IRNA.
The decision to ban Khomeini has been seen as a pushback against anyone proposing changes to Iran's clerical leadership, following the implementation of a nuclear deal which was negotiated by moderate president Hassan Rouhani's administration.
The council has disqualified thousands of applicants, most of them reformists, from standing in elections to both the assembly and to parliament, set to be held on 26 February.
Iran's former president criticised the barring of moderate candidates.
The decision is a "bad gift to the [Ayatollah Khomeini] household at a time we should all be congratulating each other", Akbar Hashemi Rafsanjani said, with reference to the lifting of sanctions following the nuclear deal.
"Where did you get your qualification? Who gave you permission to judge? Who gave you the podium of Friday prayers and state television?" Rafsanjani said, without directly addressing the Guardian Council.
Where did you get your qualification? Who gave you permission to judge? Who gave you the podium of Friday prayers and state television?
Following weeks of intensive political lobbying by Iranian President Hassan Rouhani, the Guardian Council reversed a ban on 1,500 parliamentary candidates on Saturday.
But it remains unclear how many of those approved are reformists.
In total, about 6,200 candidates, including 586 women, have been approved to run for Iran's 290 parliamentary seats.
More than 12,000 hopefuls had initially registered for the election.
The Rouhani administration "worked hard" to reverse as many disqualifications as possible to pave the way for a "competitive election", deputy interior minister Hossein Ali Amiri said.
The nuclear deal reached by Iran and world powers in January has led to more eagerness among Iranians to vote, by increasing "people's enthusiasm to have a role in their country's political, social, legislative and economic future," Amiri added.
In past elections, large turnouts have led to more seats for pro-reform candidates.
The elections are expected to be a show-down between hard-liners and moderates, who are hoping for an electoral boost following the newly-implemented nuclear deal and the lifting of international sanctions.
Iranians urged to vote
Despite preventing many reformist candidates from running, Iranians have been urged to cast their vote in the crucial upcoming elections.
Mohammad Khatami, a former president of Iran, called on his supporters to head to ballot boxes on 26 February and vote to serve "national interests".
Although "capable" and "deserving" figures have been disqualified, Iranians must vote as mass participation and "heated" elections are in their interests, Khatami said in a statement.
Iran marks revolution anniversary
Iranians mark the 37th anniversary
of the Islamic revolution in Iran [Getty]
Meanwhile, Iranians took to the streets on Thursday to celebrate the anniversary of the revolution in 1979 that saw the fall of a CIA-installed pro-Western monarch.
State television aired footage of rallies in Tehran and other Iranian cities and towns.
Demonstrators chanted traditional slogans against the US and Israel, as anti-US and anti-Israeli banners and posters were put up on the streets.
Iranian authorities displayed an array of weaponry and military hardware, including the Emad long-range ballistic surface-to-surface missile and a version of the Shahed drone which flew over a US aircraft carrier in the Gulf last month.
The rallies commemorate 11 February 1979, when followers of Ayatollah Ruhollah Khomeini overthrew the US-backed Shah Reza Pahlavi.
The United States helped orchestrate the 1953 coup that overthrew Iran's popular prime minister, Mohammad Mossadegh, which brought Pahlavi to power and set the stage for decades of mistrust between the countries.
Agencies contributed to this report