Why is this an issue?

Storing a value inside a collection at a given key or index and then unconditionally overwriting it without reading the initial value is a case of "dead store".

This rule detects repeatedly adding an element at the same index or key in a collection or adding identical elements to a set.

 fruits[1] = "banana";
 fruits[1] = "apple";  // Noncompliant

 myMap.set("key", 1);
 myMap.set("key", 2); // Noncompliant

 mySet.add(1);
 mySet.add(1); // Noncompliant

At best it is redundant and will confuse the reader, most often it is an error and not what the developer intended to do.