The reduction='mean' default is chosen, as it will create gradients which do not depend on the batch size.
E.g. the DataLoader could return a smaller sample size for the last batch, of the length of the dataset is divisible by the batch size with a remainder. This would scale down the gradients, if you are using reduction='sum'. The same applies of course if you are manually changing the batch size somehow.
Also, if you are using a weighted loss, recution='mean' will use the applied weights to normalize the reduced loss (as given in the docs). This will not be the case for reduction='sum' (the weighted loss will just be summed), which might increase or decrease the loss depending which classes (and thus weights) are found in the current batch.