Let's say you have 2 people in front of you and they both design the same algorithm and come up with the same solution (sometimes that's really the case).
One writes code that cannot be compiled while the other does. Who scores higher?
Now, let's say you are a big company and have 100 applications for that position and do the math...
If it's down to syntax errors, and the logic is correct, what the heck does it matter? Almost everyone writes code in an IDE that will deal with those syntax errors.