"I happen to have a good friend who is an attorney and a former judge and public defender, and she watches CSI. She saw this episode. I asked her if what they did was illegal, and in a nutshell, here is what she said.
The main issue would be whether or not they broke the chain of custody. If the evidence was ever out of the custodial control of the appropriate people, it could be viewed as tampering. But as long as the people who moved it were lab people and it was still safe and inaccessible to tampering by outsiders, the evidence would be admissable. It didn't go home with anyone; it was always in the hands of CSIs.
As far as this being an issue in court, she said it's a matter of the weight of it versus the admissability of it. The usual process didn't occur, but if they can always demonstrate the chain, and the original evidence is available, it's solid.
She also said that they had no need to fabricate a crime scene, validating what was mentioned above - that they could have accomplished the same thing by planting something false in the media. It's not unusual for the police to hide their intentions, such as when they claim to have made an arrest in order to lure a perp into a false sense of safety. They didn't need the science to do that; It was unnecessary and elaborate.
She felt that they took a risk in doing this because it shows how evidence can be fabricated and that could come back to haunt them.
As for the DA, she said that they should have informed the DA up front. She could have been helpful in telling them how to safeguard themselves and their case. If the DA HAD been in the loop, the case could have been prosecuted. This judge, my friend, felt that the DA's ego was the real problem, that her objections had more to do with being left out than with it happening at all."