When you're saying or writing I feel bad for someone the grammatically correct one is "I Feel Bad"
For example if someone hurt themselves you would say I feel bad for them.
I feel badly would not sound correct.
So it would be I feel bad.
But if you did say I feel badly it would imply that your sense of touch was not right.
So when you're feeling bad for someone or feeling bad for something you would say it as "I Feel Bad" which is the correct way and the correct grammar.