When a student submits a work that is a copy from a colleague, should you also punish the student that made the work?
This would depend on context, in my opinion. Given you know the identity of both the original author and the plagiarist, consider:


Did the original author facilitate the plagiarism, or was the code plagiarised without the original author's knowledge? Can you tell?  

Clearly, if the original author was the victim of someone peeking over their shoulder, or just blatantly copying code files, then they should not be punished. But if they gave help to others despite being told that this is inappropriate, then they are equally guilty of misconduct.  

It's easy for me to write this, but in practice determining whether the plagiarism was with or without consent is more difficult. I would be inclined to give the benefit of the doubt if there is any chance that one party did not intentionaly cheat.
Is there any record of the students cheating previously? If so, that might be a guide.


I would be keen to avoid punishing someone who might not have done anything wrong, but some others might not give the benefit of the doubt. It's certainly not easy to tell what exactly has gone on when two very similar works are handed in, but if you can rule out any copying without the author's awareness with certainty, then you must assume that the author facilitated cheating.

If you haven't made clear what the difference is between helping and cheating, then you can't really punish anyone fairly—if you don't clearly lay out your expectations, then you can't enforce strict rules.