Why can't a set have two elements of the same value?
Suppose I have two sets, $A$ and $B$:
$$A = \{1, 2, 3, 4, 5\} \\ B = \{1, 1, 2, 3, 4\}$$
Set $A$ is valid, but set $B$ isn't because not all of its elements are unique. My question is, why can't sets contain duplicate elements?
The short, perhaps unsatisfying answer is, because that is how they are defined. The long answer is that, in most cases, that is what is useful.
For other cases, there is also a theory built around multisets, which are like sets except they allow multiplicity.
I'd say that $B$ is valid and equal to $\{1, 2, 3, 4\}$.
The notation $B = \{1, 1, 2, 3, 4\}$ gives $B$ by listing its elements:
$1 \in B$
$1 \in B$
$2 \in B$
$3 \in B$
$4 \in B$
Clearly saying twice that $1 \in B$ is harmless.
This is the axiom of extensionality: two sets are equal iff they have the same elements.
Do not think of 1 and 1 as "two elements of the same value". They are the same element really. And an element is either a member of a set or it is not.