While some types of pornography are protected by the First Amendment, child pornography is definitely not. The main issue that trumps free speech in this case is the protection and prevention of the sexual exploitation of minors.
The Supreme Court addressed the issue in 1982, when it ruled in New York v. Ferber that states could prohibit any child porn that didn't meet the obscenity standards set forth in the Court's 1973 Miller v. California decision. The Court took things a step further in its 1990 Osborne v. Ohio ruling, which said states can punish individuals for private possession and viewing of child pornography, as this still encourages the exploitation of kids [sources: FindLaw, Hudson Jr.].
But some challenges to the child pornography laws prevailed. After Congress passed the Child Pornography Prevention Act in 1996, aimed at stemming child porn on the Internet, including virtual child porn, the Court struck down two of its provisions regarding depictions that appear to be of minors engaging in sexually explicit conduct. Ruling in Ashcroft v. Free Speech Coalition, the Court decreed those provisions were too expansive, as they could be used to, say, prohibit youthful-looking adult actors from filming a sexual scene [source: Hudson Jr.].
In 2003, Congress passed the PROTECT act to, in the Senate's words, "restore the government's ability to prosecute child pornography offenses successfully" [source: Hudson Jr.].