"We call on all Egyptians to refrain from dragging Al-Azhar into political matters and grievances because this is the only way in which the moderate version of Islam and our institution's independence will persist," Allam said.
Any attack on the Al-Azhar institution or its head Grand Imam Sheikh Ahmed El-Tayeb "undermines Egypt's security", he said.
Allam's statement comes amidst increasing calls by many of Al-Azhar University students for the stepping down of El-Tayeb following the massive food poisoning scandal on Monday.
On Tuesday, thousands of students marched from the university's campus in Cairo's Nasr City district to the main building of Al-Azhar in Cairo's Darrasa district to protest the alleged negligence by university administration.
Following the incident, the Muslim Brotherhood's Freedom and Justice Party (FJP) rejected reports linking the Islamist group to the event.