I have to admit, I'm not quite sure why you think it's a bad comment.
Has your friend had a miscarriage? In that case the comment is insensitive.
I mean, the friend could have said congratulations instead of just 'oh?' but otherwise, yeah I don't see why you think it's so bad.