> when would that ever happen legitimately?
Never. Aka, on buggy code.
Instead of asking when that happens legitimately, why don't you ask why does it evaluate to a legitimate value?
> Why would you expect any language to do something that made sense doing that?
Because raising an error in those cases would:
1. Make the language simpler and easier to understand (and to implement). No coercion rules, not guessing what some other developer meant when they wrote `a == 0` (are they asking for numeric equality, or could `a` be a string or a boolean value too?).
2. Make it easier to identify the bug in case it should happen.
Let me ask you, do you also think syntax errors are unnecessary too? Because, why would anyone write a program with invalid syntax? Why would one expect any language to do something that made sense, like not compiling/running the code, in those cases? Wouldn't it be better if, for example, in case a line contains a syntactic error, the interpreter would just discard that like and run the program anyway?