I think it's a question that shows a severe prejudice against people of beliefs other than one's own.
It is a horrible thing to blame someone for someone else's misfortune simply because they don't have the same beliefs and habits you do. What a terrible cruel thing to say. I find the question incredibly offensive.
When someone is ill or has trouble in their life, I say, 'I am so sorry to hear that, I hope it is over soon'. And I wish them the best.
I do NOT pick on people who don't pray or wish a person well. That is their choice and not mine to judge; aside from that, criticizing them involves an assumption about WHY they are doing what they are doing, and no person is capable of mind reading.
They may be too worried about problems of their own, or they may be confused about what they should say. They may be afraid to say the wrong thing. They may have had a conflict with the person in the past and think any kind words will be responded to in anger.
Or MAYBE - just MAYBE - when they do wish a person well or pray for them, they don't like to make a public spectacle of themselves, and they would rather pray for someone privately.
Maybe they don't want the person to feel obligated to them, or embarrassed.
Maybe it is just their way to be quiet about such things.
I know a number of people who would be MORTIFIED to say out loud, 'I'll pray for you'. To them, that is 'prideful' and very, very wrong - pridefulness is one of the worst sins - it is defying God's will.
It really, really is wrong to judge people for their faith or their habits. That just isn't anyone's job. It isn't something God or Jesus or even our local minister or pastor or priest would encourage us to do.
You never know WHY people do things. To assume you know is 'magical thinking' and it is a very, very dangerous and slippery slope to start on. A person is far, far more happy if they do NOT think they have the power to read minds and know a person's reasons for doing something. IF they try to pretend they know why, they are pretty much guaranteed to be wrong 100% of the time.
When I have a worry or illness, I accept all good wishes, and every single kind of prayer, regardless of the religion or belief of the person, as well as every good wish and kind word, graciously. Any kind word is fine for me.
I have friends of almost every religion in the world. I have atheist friends, agnostic friends, confused friends, non-Christian friends, Christian friends of every denomination.
I love all of them equally, I appreciate all of their well wishes, and I believe that God loves all of them as well.