The NaN, being an NV, is being evaluated in numeric context, not "string" context. And the string "foo", when evaluated in numeric context, will be false (0).
I don't think there's any inconsistency there ... except perhaps that "foo", when evaluated in numeric context should really be NaN, not 0 ;-)