...How does the fact that somebody else has it worse make my situation any better?
It isn't meant to make you feel better, just less bad.
More along the lines of comforting you since many people in a bad situation start to feel like they are the only one or are being singled out. Having someone remind you that there are others going through difficult times can alleviate the feeling of being singled out, and can provide a person comfort knowing that other folks are out there struggling just like you are.
I'm not saying it works for everyone, or that you should grasp my idea whole heartedly. Just saying that this is one of the ways people try to comfort others.
-Mike