Consider the facts of the case. Members of the Westboro Baptist Church protested on public property, over 1,000 yards away from the funeral of Matthew Snyder. Although the signs were certainly offensive, they did not mention members of the family by name so as to start a fight. And they did not urge people to commit acts of violence. In other words, the protest clearly did not meet the standards of fighting words or incitement to violence — categories of speech that are unprotected by the First Amendment.
I agree that the protest was morally despicable. So did the justices. Still, Westboro members participated in a peaceful protest on public property. To ban that behavior would set a very dangerous precedent.
(I actually love to see Christian people whining about the Phelps. I just shake my head and laugh, they have their interpretation of the Bible and you have yours.)