The rule was popularised by Martin Fowler in Refactoring[1] and attributed to Don Roberts.
Duplication is considered a bad practice in programming because it makes the code harder to maintain.
However, choosing an appropriate design to avoid duplication might benefit from more examples to see patterns in.
Attempting premature refactoring risks selecting a wrong abstraction, which can result in worse code as new requirements emerge[2] and will eventually need to be refactored again.
The rule implies that the cost of maintenance outweighs the cost of refactoring and potential bad design when there are three copies, and may or may not if there are only two copies.