I don't know if there's any psychological basis for this, or if anyone else does this, but personally I jot down loads of notes when learning things and playing with ideas. However, I rarely read back over them. Instead, just the act of writing them down is sufficient to stick them in my brain.
I guess the same applies to learning with code samples.
I guess it works for some people, but not me. And I've copied a lot of code. I'm from the generation of kids that would copy hundreds of lines of code from Compute! magazine. I rarely understood the code as I was typing it. Only after when I could look at it holistically and tweak it, could I understand it.
Unfortunately, looking back with hindsight, Compute! et al were not good places to learn about code because the programs in the back were optimized so heavily that there was hardly anything to get a grasp on. Especially the programs that were just a long, long series of DATA statements and a small stub to load them somewhere, then jump to them. Tweaking them afterwards was your only hope.
I've learned tons from using Firebug. In part because I could start with prewritten code and tweak, and read, and tweak, and read. If I had to enter all the code manually into Firebug (no copy and paste), I think I'd have better muscle memory for typing some of the stuff, but I don't think I'd be a better developer for it (not that I'm a web dev, but just sayin).
I've finally gotten to the point where I can tell when my brain isn't learning like it should, but I still can't just will that mental state away.
If it works for you, go nuts. It's a surprisingly rare skill, but I think it exists. Every once in a while I can reach that level (mostly in code reviews; for some reason that makes it easier).
Another reason is because anyone who's good at coding learned it this way. Anyone who's bad at coding tends to just copy paste. Usually, you should copy what people who are good at something do.