But that still ignores the issue about whether puzzle solving and programming ability are highly correlated.
(Assuming you're working at a firm that actually develops software, instead of handing a template to some code-monkeys and telling them to use off-the-shelf Microsoft or Java widgets and assemble them into something vaguely resemblant. But the latter firms don't really use puzzles anyway. They hire based on degrees and certifications.)
If you think that they'd make superior employees, nothing is stopping you from employing them. If you're correct, that will give you a significant advantage over employers who make the wrong choice. Why aren't you willing to make money from being correct?
In a world without such laws, what you say applies.
One could argue that such content questions discriminates against certain groups of people without supporting research showing such memorizing ability is necessary for programming.
So should such questions be illegal in technical interviews --- at least until the supporting research is done and widely accepted?