It is always good to say "sorry" in certain situations, in fact I recommend doing so. In my opinion, the word sorry should only be used in two situations;
1. When you have made a mistake.
2. When you have a personal relationship with someone and they tell you about something bad that happened to them.
The downside of using the word sorry is that your brain registers it as something meaningful to you and plays on your mind. I bet that when you have said sorry to someone you would have thought about the situation later in the day. Why, because sorry is such a personal word.
To overcome this dilemma, here are two strategies that you may wish to consider when use of the word sorry.
Mistakes
If you make a mistake, by all means use the word sorry. It is more personal and if said immediately with sincerity it will gain rapport. If someone else has made a mistake, try using the word apologise.
The word apology is more formal and your brain does not register the situation as personal to you therefore you won't think about the situation negatively when reflecting later in the day.
Sad News
If someone tells you sad news, such as they have lost a loved one, and you do not have a close relationship with that person, try to avoid using the word sorry by itself such as "I'm so sorry" or “I’m so sorry to hear that”. Extend your sentence by saying "I'm so sorry for your loss", or "I am so sorry to hear that this has happened to you". That way your brain knows that it is not something personal to you.
If you wish to, you can also acknowledge their emotion by saying something like "That must have been/be hard for you", or "How can I make this easier for you", or perhaps "Thanks for sharing that with me".
If the person is overcome with grief or emotion, start asking short questions that they find easy to answer and will allow them to regain self-control. Ask questions such as "Would you like to take a break", "Would you like to call me back", "What time would you like to call back", or "Is there someone that I can call for you".
The word sorry is a powerful word and saying sorry is a good thing, but use the word wisely otherwise it becomes meaningless and will negatively impact on you.