Earlier quoted context omitted.
No, it isn't legal. He is just being a troll for Yahoo decreasing the value of his prized facebook shares.
Honest question: Which law or code does it violate? It's not like he's refusing to hire people of color or Vietnam veterans or even transsexuals. (Edit: I realize it might sound strange, but there's a legal basis behind that ordering it's not just my preferences :-) He's refusing to hire certain resume' histories arguing that it is professionally relevant.
Second, he is creating a hostile work environment for his own employees who may feel differently about the case, or who have come from companies that collapsed as he is expecting Yahoo would.