There are lots of real issues with pill testing. For example police have every right to assume anyone who enters a pill testing tent at a festival has drugs on them, and can search for drugs / charge them with possession. And, because cops are assholes, some of them will absolutely do that.
Another issue is if a pill is tested, then someone takes the pill and dies... whoever did the pill test has failed in their duty of care to prevent the person from taking a dangerous pill.
Legislation that prohibits cops from being near a pill testing tent, or removes liability for bad medical advice, would be very difficult to get passed into law.
Both these problems are resolved for the safe injecting room. There's agreement with the cops to not bust users entering and leaving. And liability can be limited to what you can control.