That's something I debate a lot with people -- if the law says "X must be done" and X is not done, then how is that a loophole? We're just saying that everyone has to obey the law, even the police and DAs. If there were no consequences then there would be no reason for police to follow the rules. I think it works well as a "checks and balances" against potential abuse. Yes, sometimes the guilty may go free, but the other option -- police can do whatever they want -- is worse.
I had a case one time where an officer pulled over my client for having tinted windows. That's a $25 fine. My client was a black kid driving an expensive car (his Dad's, who was a businessman). The officer called for backup, made my client get out of the car, and then after giving him a ticket, did not let him know he could go but instead, while police lights are flashing and the kid (who had never been arrested before) was surrounded by police with guns, asked the kid "Oh, do you mind if I check your windows?" The kid, feeling as if he had no choice said yes and then the officer went into the car, took the keys, and searched the entire car, finding marijuana locked in the trunk.
Now come on. Yes, the kid was technically guilty, but do we want to allow police to do this sort of thing in America?
So yes, his charges were dropped. Some people would call that a "technicality" but since the Constitution requires probable cause before a search, I'd say it supports the law, not defeats it.
(There are, of course, always examples where this can go too far, just like there are examples where it can go too far in the other direction)