The thing is that you tried. If you left them to wallow, who knows what could've happened? You showed them that you care and 9/10 times out of ten thats what matters. Even if you didn't sort out the problem at hand, at least they know that someone out there cares for them in some shape or form and thats just lovely, to be honest. So no, to answer the quote below it, it's not a bad thing to be sad when another person is sad for sad reasons, it's called empathy and you seem to have a great connection with it.
It's actually called sympathy.