Remember that a woman who has given birth to a dead child has given birth and is recovering physically, too. Don't be afraid of grieving parents.
In general, I think people are worried about saying the wrong thing to any grieving person. On a very basic level, I think they're frightened of touching off tears or sorrow, as though someone tearing up at the mention of unhappy news would be the mentioner's fault.
Grief lasts longer than sympathy, which is one of the tragedies of the grieving.