Well, yes, it can be ok depending on the circumstances. But we don't know what the OP's specific circumstances are.
But now that you have described the nature of your relationship with your ex, it is clear your situation is very different to the OPs.
You and your ex had become friends and were part of a wider social group and had good boundaries and that is great and you are describing a supportive and genuine friendship. The OP is no longer in contact with this ex, which couldn't really be much more different. Your situations are not the same. So, yes, it does depend on the circumstances.
I am advising the OP to reflect on, and exercise caution in, her specific situation not suggesting there was fault in your specific situation.
So, no, people shouldn't go around suppressing a 'kind impulse' but I do think people should reflect before acting on it.
For example, I have an ex who has become part of my wider friendship circle. I would appreciate contact from him if I were in a dire situation or very ill - that would be kind. However, I would be extremely uncomfortable and not very happy if someone I knew had gossiped about me to an ex I'd made no effort to remain in contact with and they crawled out of the woodwork. The OP is not the only person to consider in this scenario.