Because the goal of the assignment isn't to write code, it's to learn what code to write. If you're copy and pasting from someone else you're potentially skipping out on a lot of learning. Granted, good luck passing the exam with copy and paste, but I've seen someone do basically that for 5 years, don't know if they ever graduated but they were grinding it out.