Thousands of Afghans pushed out of Iran are living in the Afghan border province of Nimroz without shelter, angering politicians who said the ministers should have stood firm against the expulsions.
Spanta had been in the post of foreign minister just over a year following a cabinet reshuffle last spring.
James Bays, Al Jazeera's correspondent in Afghanistan, said the vote will be major political headache for Hamid Karzai, the Afghan president.
Spanta will now have to resign and Karzai has the option of putting forward a new name for the role or he can try and reappoint Spanta.
Bays said though the pretext for the no-confidence vote was the refugee crisis, some MPs also wanted to show their displeasure at Karzai's government and undermine him.
A roadside bomb exploded near a vehicle carrying policemen in southern Afghanistan on Saturday, killing eight, the police said.
The attack happened on the outskirts of the city of Kandahar, and the provincial police chief Esmatullah Alizai blamed the Taliban for it, although he offered no evidence to back up his claim.
"Of course, Taliban are behind this attack," he said.
Mullah Mohammad Omar, the Taliban supreme leader, has called on Muslims to unite against international forces in Afghanistan and Iraq.
The fugitive Omar issued a rare statement, calling on Afghan and Iraqi fighters to put aside sectarian disputes.
"While the oppressor Americans are pounding bombs on innocent people... they are meanwhile attempting to separate Muslims by ethnic, religion and tribal [differences]," the statement quoted Omar as saying.
"I call upon all jihadi [holy warrior] leaders, national figures and politicians to join hands and free their beloved countries from the hands of infidel Americans," Omar said.
He called on the same groups to form a "pure Islamic government" once international troops are ousted.