This question is more about social interaction than language use.
Think about how you'd express your "real sympathy" in your native language. There are socially accepted formulas in every language and every society and culture, but your "true feelings" are expressed more by the tone of voice and the body language that you use rather than the words (unless the words are obviously inappropriate for the occasion).
If someone else's mother's been hospitalized for an illness, That's too bad isn't the best expression. I'm really sorry to hear that plus, perhaps, I hope she'll recover quickly is much better. Stick to the formulaic if you can't come up with a spontaneously appropriate expression.
My son, a native speaker of Chinese, not really a native Anglophone, says too bad all the time. I find it annoying, but I think he learned it from me. I use it for stuff like having to work two weeks straight without any time off and other unpleasantries of everyday life, but never to express sympathy for sickness or death or anything else that's serious.
Although it's difficult to say "Too bad" without sounding sarcastic, it's possible. I wouldn't advise it, though, because it's too terse, too curt, to be sympathetic. "That's too bad" is a little better, but, depending on your tone of voice and body language, it can express sympathy, but it's not the best way to be taken seriously by someone who's grieving about a loss or an ill relative.
Best Answer
I wouldn't say that the phrase What is for? is completely ungrammatical. Phonetically, it sounds like you're literally asking what does the word for mean:
What for? is, of course, the idiom you should use in this situation because it's a legitimate expression in English and it means exactly what you intend to say:
Example: