The 3 great virtues of a programmer according to Larry Wall:
Laziness, Impatience and Hubris
Laziness: If someone has done half of the work already, why would I waste my time enacting what will be the same result from scratch when I can just take theirs, modify it either by adding, omitting or altering the definitions within? I'll just copy their homework, then use their homework as a template. Obviously an exact replication would look like plagiarism so I will at least spend some time refining it so that they don't look the same.
Impatience: Even if I was excellent at writing code from scratch, if I spent all my time coding I wouldn't have enough time to work on the rest of my projects. That is... unless I delegate that part to others. Thus modifying existing code allows me to save up on time.
Hubris: ...according to Larry Wall, it means that you ensure the code you are using works and won't malfunction or if it does, then the error produced won't be serious enough to cause noticeable issues. It is not enough to copy and modify existing code. If the code doesn't work, then based on my observation of other pieces of code which I know work, I will attempt to figure out why that's the case and from there I will correct the error if it can be corrected. Also, when I sell my products I want to ensure that the player doesn't have to troubleshoot the error messages themselves. I've had to do that a couple of times and it was annoying.