A fascinating opinion from a Ninth Circuit en banc panel. How Appealing summarizes the matter well; to put it briefly:
(1) The Supreme Court has held that speech may be used as evidence of someone's intent, motive, or even actions. For instance, someone's having said "I think Muslims deserve to be killed" may be evidence that his killing of a particular Muslim was deliberate (intent). It may be evidence that the killing was motivated by the target's religion and thus eligible for a hate crime enhancement (motive). And it may be evidence that the speaker was the one who did the killing (motive, which, coupled with other circumstantial evidence, can tend to show action).
(2) The First Amendment question is when this extends to evidence of what someone has read, and in particular to evidence of fiction that one has read -- here, whether defendant's likely having read explicit stories involving sex with children can be introduced to show that he really intended to seduce a 14-year-old girl, rather than just play-acting with someone he thought was an adult. Judge Trott concludes there's no First Amendment distinction there; Judge Klenfeld, joined by Judges Pregerson, Kozinski, Thomas, and Berzon concludes that there is a First Amendment distinction.
(3) There is also some disagreement, related to the constitutional question but analytically distinct from it, whether this evidence was admissible under the Federal Rules of Evidence governing relevance (Rule 401), unfair prejudice (Rule 403), and prior acts evidence (Rule 404). (If the evidence is inadmissible just because of the federal rules, then it might be admissible in state criminal prosecutions, if state courts interpret the analogous state rules differently; if it's inadmissible because of the First Amendment, then this prohibition would apply to all jurisdictions.)
In any case, a fascinating question, and one that has some relevance to debates about the possible speech-deterring effects of hate crimes laws. (See, e.g., United States v. Magleby, 241 F.3d 1306, 1318-19 (10th Cir. 2001), cited in the majority opinion, which allowed evidence that defendant had listened to racist music as evidence that defendant's cross-burning -- a punishable threat -- was racially motivated.)