Developers damn better be able to write code. But writing code and writing code during a job interview are two very different things!
If you only hire people who can write code during job interviews, you might get a great guy who was completely relax during the interview. Or you might get someone who's OK at writing code, and miss out on someone 100 times more productive only because they were nervous during the interview.
Nervousness is poison for thinking, fear is the mind killer, etc. I've always been most nervous at interviews for jobs I really, really wanted. Not because I needed a paycheck, but because I was passionate about the job.
Advice for job candidates: Drill coding under pressure.