According to U.S. law (if I understand correctly), evidence obtained in the course of an illegal police search is inadmissible in court. Presumably the purpose of this rule is to discourage the police from conducting illegal searches. But aren't there better ways to do this? Consider my old principle of moral sacrifice: we should set things up so that, in extraordinary cases, public servants can take extralegal measures and personally suffer the consequences. ("If an end is worth torturing someone for, then it's worth going to prison for.")
This principle suggests that we should allow illegally obtained evidence in court, and instead punish the police officers who were personally responsible for obtaining it illegally. If the punishment is suitably severe (e.g. losing their jobs), this will suffice to deter routine police malpractice. But - importantly - it leaves open the possibility of achieving justice by unconventional means in those rare cases where the stakes are so high that an officer is willing to sacrifice his own career to see justice done.
Am I missing something?