Arguably, that's the role of certifications and degrees. If you want a standardized test of someone's familiarity with a particular programming language, you could look for people that have a particular language certification. If you want a standardized test of general computer science knowledge, look for someone that has a computer science degree.
The problem, of course, is that we all know that these sorts of credentials are far from perfect. It is too easy for people to cram for a certification exam once the exam topics are finalized without actually learning anything or being able to apply the knowledge. A rather large fraction of solid developers aren't going to bother going through the certification process. And trying to be certified on everything an employer is looking for (languages, development processes and methodologies, etc.) would be quite onerous. Computer science degrees are also fallible-- there are people that complete their degree without ever managing to learn how to write useful code and there are people that learn how to write great code while majoring in something else.
Given that the standardized approaches have demonstrated themselves to be insufficient in the real world, it's exceptionally unlikely that a standardized exam would fare any better. It would almost certainly end up getting gamed just like existing certification exams. People would cram for the exam or get access to the questions from "brain dumps". Existing developers wouldn't all run out to take the exam. And employers wouldn't be willing to rely heavily on the exam results. So they're still going to want to ask technical questions in an interview.
Beyond that, though, a good technical interview (obviously, there are bad interviewers and bad questions just like there are bad developers) should also be about assessing how a candidate's approach will mesh with the current team. A good interview ought to assess a candidate's communication skills and their soft skills just as much as it assesses their technical skills. I'm much more interested in a candidate that asks good questions to clarify the requirements and that explains their thought process well even if they don't immediately come up with the best algorithm over someone that comes up with a great algorithm but can't explain their answer effectively or discuss trade-offs effectively.