Yeah, it sucks when that happens.
There should be a way to play the mediator and end wars... I mean, Will Wright once talked about a 'Space Counsel' where you made laws and stuff...
...yeah right. More like you get to blow stuff up and get punished for it because you have no say, even though you're the Omnipotent being in the universe.
Oh well, anyways... You have to choose, or let them fight it out.
You can either help one race destroy the other, or you can let their battles go on until one eventually destroys the other. Either way, that's you're only choices.
Also... never quit what you're doing for an ally being attacked. Most planets can defend themselves, the computers ALWAYS buy turrets when they need them, and if they can't defend themselves it's not that big of a deal if they lose a planet... at least it's not your planet.