Well, the writing-part isn’t the bad part about duplicated code. It’s the maintaining of it. In particular, if you duplicate logic, it happens all too quickly that you make modifications to one, but not the other, or you make differing modifications to both.
Eventually, you’ll end up with two wildly different versions, where you won’t know why certain changes were made and not applied to the other version. Similarly, if you do need to make a similar change to both, you might now need to implement it two times.
I guess, I do agree that it isn’t *always* worth it, but in my experience, it is far more often worth it than one might think.
My pet theory is that our brain rewards us for interpreting clues correctly, because this is crucial for survival. And patterns make it easy to do this interpretation correctly, therefore triggering the reward system frequently.
But if it is too easy to interpret a pattern correctly, the reward will be lessened, because the challenge you succeeded in was lesser. And it was also crucial to survival to fade out patterns which don’t change, so that e.g. the wind brushing through leaves doesn’t drown out the noises from a predator approaching.
That’s why patterns which don’t change every so often stop triggering the reward system and therefore bore us.