States cannot restrict efforts by defendants in death-penalty cases to blame someone else during their trials without a judge examining the strength of both the defense and prosecution’s evidence, Justice Samuel Alito said Monday in his first opinion.

By a 9-0 vote, justices said a South Carolina defendant’s constitutional rights were violated by a rule that barred him from introducing testimony blaming another man because the prosecution had introduced forensic evidence that appeared to support a guilty verdict.