Why would a university restrict publication of work due to plagiarism fears if TurnItIn was used? I used to host some code I'd written for university assignments publicly on my GitHub account (after the deadlines had passed, of course). Before long, I received an email from the dep't asking me to take it down due to fears of plagiarism (if students were given the same or similar assignments in the years subsequent). 

I did so, but recently I've been thinking - my university uses Turnitin for plagiarism detection, which as I understand it means that my code is already in the Turnitin database as shown in the below excerpt from this FAQ:


  Misconception 7: Every student paper submitted becomes part of the Turnitin database--forever.
  
  Reality: Turnitin has many options--including the ability to offer students an "opt out" of the database and the option of having an institutional database of student papers.  Student papers may be removed only by request of the instructor of the class.


I don't recall opting out of anything, so if my code is in the Turnitin database surely undetected plagiarism wouldn't be an issue? Of course, the morality of providing a desperate student with both the temptation and means to plagiarise is another issue entirely.
Those plagiarism checkers can only detect certain kinds of plagiarism. They will detect for example if text parts are the same. They won't detect missing references or plagiarized ideas. 

So if you host your assignment there then others can be "inspired" by that, and if they rewrite everything in their own words and change the code in certain ways but don't cite your GitHub project then it would be a plagiat. But Turnitin might not recognize it as such. Especially since I guess you would need to set the detection level quite low, because for such assignments there will always be a certain overlap in the results if everyone solves the same problem.