Nalanda, (and Vikramashila, Odantapura etc.) were Buddhist vihars (monasteries) which have been retconned into “universities” in modern times. Mind you the Western university grew out of Catholic Church institutions so it is not completely far-fetched but there is a lot of wishful thinking involved.
Far from letting anyone lecture, an important office in those places was the dvarapala (“gatekeeper”) This was a senior scholar whose job was to examine applicants and only those who passed his tests were allowed inside.
Amusingly, recently corrupt bureaucrats have attempted to re-instantiate Nalanda. Despite gathering a huge amount of dirty money and land they've only put through a handful of postgrad students, and already have weathered multiple substantive allegations of corruption, sexual harassment, etc.
Perhaps people are the problem.