Ms Dastjerdi was also the first woman minister in the 30-year history of the Islamic republic.
While no reason has been given, the dismissal is being linked to her call for drug price rises to fight shortages caused by international sanctions.
Mr Ahmadinejad rejected her comments, saying her budget needs had been met.
Analysts say international sanctions have done significant damage to the Islamic republic's economy and led to a steep currency plunge.
Although they do not directly target medicines, they limit their importation because of restrictions on financial transactions.
Prior to her dismissal, Ms Dastjerdi said that because of the rise in the foreign exchange rate, there would be an inevitable increase in the price of medicine.
She complained of her department's inability to get access to foreign currency she had been promised.
"In the first half of the current year, the Central Bank has not allocated any exchange for the import of drugs and medical equipment," she said.
"We need $2.5bn (£1.6bn) in foreign exchange to meet the needs of the medical sector for the year, but only $650m has been earmarked."
But President Ahmadinejad said in a TV interview that enough money had been allocated to the health ministry.
"No-one has the right to raise the price of medicine," he added.
Mohammad Hassan Tariqat Monfared has been appointed as interim health minister, the Reuters news agency reports.
The EU and US recently announced new sanctions over Iran's nuclear plans.
They suspect Iran is seeking to develop nuclear weapons, something it denies.
Ms Dastjerdi was the first woman minister of the Islamic republic, although a woman did serve as vice-president for the environment under Mohammad Khatami.
Iran's President Mahmoud Ahmadinejad has sacked Health Minister Marziyeh Vahid Dastjerdi, the sole woman in his cabinet, state television reports.