Why compiler allow to put unreachable code after return?

If this situation Unreachable code? is still actual - we have two different variants of behavior. In one case this is error, in another this is warning.

Yes, Dmitriy, you are right about warn-severity for code that does not make sense. But my argument is that code after return is potential point for bug. This is answer to your question about benefits of moving to errors.
And from opposite side - I didn’t see any disadvantages when such situation is considered as error by compiler(Java variant).