The 33-year-old tested positive for d-methamphetamine at the Bank of the West Classic in Stanford this summer.
A statement from the International Tennis Federation read: "An independent hearing was held, in which Ms Llagostera Vives was not able to demonstrate how the d-amphetamine entered her system.
"She was, therefore, unable to satisfy the preconditions for mitigation.
"Ms Llagostera Vives's commission of an Anti-Doping Rule Violation was, therefore, confirmed and it was determined that she is suspended from participation for a period of two years, commencing from 8 September 2013, the date on which she was provisionally suspended."
Llagostera Vives reached a career-high singles ranking of 35 in 2005 but has played only doubles in the last two years.
She had been due to partner Italian Francesca Schiavone in Stanford but the pair withdrew prior to their first-round match.
The decision follows hot on the heels of suspensions for Marin Cilic and Viktor Troicki, both of whom had their bans reduced on appeal by the Court of Arbitration for Sport.