Searches and seizures must be "reasonable." Reasonableness is determined by appellate courts, must notably, the U.S. Supreme Court. If searches aren't reasonable, the typical remedy is for the trial court to "suppress" the evidence in question, meaning that the prosecution can't use it against the defendant.