My guess is that it's for drop-in compatibility with make.
There is (at least) one open issue about this - the solution/alternatives are not trivial:
https://github.com/ninja-build/ninja/issues/1459