Another interesting point about Leetcode-style interviews I've not seen raised: it's a form of intellectual hazing.
It's been proven many times that the severity of an initiation ceremony significantly boosts the commitment of those admitted to the group.