The 30-year-old, who reached the French Open final in 2012, tested positive for banned drug letrozole.
Errani's mother had been using the drug as part of her breast cancer treatment.
But she had dropped some pills on a kitchen worktop where tortellini and broth were later prepared.
A tribunal panel accepted the player probably ingested the substance through accidental food contamination.
But it was ruled Errani, now ranked 98, could have done more to protect herself, leading to the two-month sanction.
Letrozole increases lean body mass and was banned by the World Anti-Doping Agency (Wada) over concerns it was being abused by bodybuilders.
An independent tribunal, appointed by the International Tennis Federation, said there was no evidence it would enhance the performance of an elite tennis player.
It is the most high-profile drugs case in women's tennis since that of Maria Sharapova, who beat Errani in the 2012 French final.
The Russian returned to the tour earlier this year after she was banned for 15 months on appeal following a positive test for meldonium.
Errani's mother and father told the tribunal hearing in July that after the positive finding, they carried out an experiment which found the drug dissolved in a broth, plus a meat mixture for tortellini, without being detectable.
"Together with my family we have tried to understand how this contamination could have happened because I am 100% certain I haven't taken a pill by mistake," said Errani in a statement.
"The only viable option has been that an accidental food contamination occurred at some stage in the house."
She accepted a charge of violating anti-doping rules in April. The ban is effective from 3 August.
Errani said she was "very frustrated" and "extremely disappointed" by the sanction but was "at peace with my conscience and aware I haven't done anything wrong".
In 2012, she stopped working with Luis Garcia del Moral, one of the doctors at the centre of cyclist Lance Armstrong's doping scandal.
"I'm not interested in keeping working with a person that is involved in these things," said Errani at the time.
Italy's former world number five Sara Errani has been banned for two months after failing a drugs test - because her mother's cancer drug accidentally contaminated a family meal.