Gonzalez, 30, tested positive for the anabolic steroid trenbolone on October 17 last year and will be suspended until November 2022, said the independent body which polices drug abuse in athletics.
However, she will retain her medals received in 2016 when she won silver at the Rio Olympics and 2017 when she was runner-up at the world championships in London.
At a hearing, the unit rejected her defence argument that her positive test stemmed from the fact that she had increased her consumption of red meat to combat anaemia.
Trenbolone is a permitted additive for animal feed in Mexico, Gonzalez said, insisting that the meat she ate was contaminated with the steroid.
However, the AIU determined that evidence provided by the athlete to support her arguments had been forged and added that the concentration of steroid was too great to come from contaminated meat consumption alone.
Gonzalez has the right to appeal the decision at the Court of Arbitration for Sport.