The Sanctuary spell reads:
[…] any creature who targets the warded creature with an attack or a harmful spell must first make a Wisdom saving throw. On a failed save, the creature must choose a new target or lose the attack or spell.
Imagine a case where two orcs (allied to each other) are standing next to each other and next to me (their enemy). One tries to attack me and fails the save. Does he have to attack his Orc friend, or can he choose not to attack anyone?
The spell is ambiguous. You can either read
the creature must choose a new target or lose the attack.
So, you can choose either of these options. Or it can read
the creature must choose a new target or lose the attack.
So the creature needs to choose a new target, and if unable to, it loses the attack.
Best Answer
He can choose not to attack
Either way you put it, there is always the option of "losing the attack", which is ultimately the same as choosing not to attack (if it wasn't an option, it wouldn't be stated).
Repeating your quotes but using brackets to separate the options: