The coding interview itself is an immune system against the surprisingly large population of candidates who have long resumes and can talk a big game but not actually perform. (I didn't believe these people existed either, until I started doing phone screens).
It's also a way to recognize smart people who will do well with whatever they're given, even if they're underutilized or in a different domain at their current job. Tech companies are typically hiring more for this than for tech stack or business domain similarity.