You are probably better off using Lisp formulas for things like this. As @db48x's answer points out, there are a couple of cooks in that kitchen and what they are doing is not always obvious. Formula debugging can help but it is not always effective (I presume that's how @db48x discovered the "(a)" thing, but that may not be the case).
I find the string conversions unpredictable, so for non-numeric things in particular, I tend to stay away from calc formulas and do it in Lisp instead.
In this particular case, try the following:
| a | 1 |
| b | 0 |
#+TBLFM: $2 = '(if (string= $-1 "a") 1 0)
The disadvantage(?) is that you have to learn some Lisp, but that's a good thing: otherwise, how are you going to tinker with all those Emacs settings?