Are there formal or informal hiring bans in some academic settings based on gender and/or nationality?
You are unlikely to get examples about formal hiring bans, in particular in western societies. It would not only be frowned upon, as in this case; it would also be against university policies, if not downright illegal. The only formal hiring bans I could think of are those implied by more general rules. The most obvious case coming to mind is that about 20 countries don't allow people with Israeli passport to enter, which means they cannot study or teach there either (about half a dozen or so countries extend this to people with other passports but evidence of a travel to Israel). 

Unfortunately, it is possible that the professor was speaking a truth about what some consider in their hiring decisions...where usually they would only have the common sense to not explicitly admit the true reasons for their decisions. They would start where this professor is now: claiming that their labs are full. This is human nature, and academics are no better or worse than their fellow humans dealing with their fear and prejudice in regrettable ways.