BERT Masked Language Model question
In this context, masking means replacing the token with a special [MASK] token. The network does not have the information of what the original token was, the only way how it could potentially figure out what it was is by looking at the context.
It is not the loss function that guarantees that the model learns something meaningful, it is architecture design that does not allow the workaround that you suggest.