That’s how indexing works.
The values at pred[0] and pred[1] are both 1.
If you index something at position 0 and 1 (given by pred),
you will get a tensor containing (label[1], label[0], label[1], label[0]) = (1, 1, 1, 1)
label = torch.tensor([1, 1, 0, 0])
pred = torch.tensor([1, 0, 1, 0])
print(label[pred])  # tensor([1, 1, 1, 1])
print(label[torch.tensor([0, 1, 2, 3])])  # tensor([1, 1, 0, 0])
print(label[torch.tensor([3, 2, 1, 0])])  # tensor([0, 0, 1, 1])

Have a look at the numpy indexing docs 14 for other examples.