The two sides shared the points in a dramatic finale as Iran were awarded a controversial late penalty through VAR, before almost nicking qualification to the knockout stages from Portugal in the 95th minute.
Iran just missed out as Portugal did enough to qualify, but Shearer has said that there would have been "chaos" had the former netted in the final stages of the game.
"Farcical. Shambolic. The referee is a very lucky guy. If Iran score at the end it would have been absolute chaos," Shearer told BBC Sport.
"How on earth can he think that is a penalty? If he thinks it is deliberate handball, he is crazy. There is no way on earth that is deliberate handball. It turns the game into an absolute farce.
"You are playing in the biggest competition in the world and it seems like VAR is on trial and it is not right."
Spain and Portugal qualified from Group B as Iran and Morocco were knocked out of the competition.