The versatile attacker, who was playing for Sevilla at the time, was found with a prohibited substance in his system shortly before the World Cup got under in Qatar last year.
The 35-year-old featured twice in the global tournament as he joined Lionel Messi and co in lifting the trophy.
According to Spanish outlet Relevo, Gomez blamed the failed test on taking his children's sickness syrup without consulting club doctors after having a bad night's sleep.
That explanation was not deemed to be sufficient to avoid a ban.
While Gomez and Sevilla found out about the failed test several months ago, it was just this week that the player received his sanction.
READ MORE ON SERIE A
Olivier Giroud named as goalkeeper in Serie A's Team of the Week after AC Milan heroics
Pogba tests positive for banned substance in back-up sample but will fight to clear name
He must now decide whether to appeal the ban or not.
Gomez left Sevilla by mutual consent on September 1 after two-and-a-half-years at the club, before completing a deal to join Italian side Monza.
Confirming the ban, the Serie A side said: "AC Monza announces that it has received today - October 20 2023 - from FIFA, through the FIGC, notification of the first degree sentence of the Spanish Anti-Doping Commission, issued against the footballer Alejandro Dario Gomez.
"The sentence includes a two-year disqualification from sporting activities.
Most read in Football
Oxlade-Chamberlain explains 'biggest difference' between Arsenal and Liverpool's mentality
Ipswich's clash with Rotherham called off just hours before kick-off due to Storm Babet
Chelsea and Wolves set for Christmas Eve clash 'barring huge backlash' from fans
Simon Jordan aims savage dig at Football Focus as BBC quietly axe spin-off show
"The presence of Terbutaline was found in the footballer's biological samples.
"It is a drug taken to calm a bronchospasm crisis, in October 2022, when the footballer was registered for Sevilla FC.
"Positivity is the result of an involuntary assumption.
"AC Monza reserves the right to evaluate the next procedural steps."
While Gomez has played just two matches for Monza since joining, he's best known for his time at Atalanta between 2014 and 2021 where he was captain and scored 59 goals in 252 appearances.