Even if your ally does very little to fight your common enemy -- or even nothing at all -- having allies in a war can still be very beneficial.
For one thing, your common enemy is likely to send units against all attackers, whereas without allies they would all be directed against you. If your ally is weak, then the enemy might be more likely to go that direction, leaving your homeland safer.
All trade ceases between warring civs, so if your ally had any agreements with your enemy, they're now broken. If your ally was supplying the enemy with important resources, your enemy is now much worse off.
These (now broken) trade agreements may also include open borders. When at war, the enemy can still go on your ally's land, but gets no benefit from roads or railroads, but you do. If your ally is between you and the enemy, this alone can be huge.
Even if the common enemy starts to gain ground against your ally, this can also be to your advantage in a diabolical way. I have had games where the enemy takes a city from my ally, then I take it from the enemy. That way you gain your allies' cities without them hating you for it.
Finally, the diplomatic repercussions can be very useful. Keeping the AI civs at odds is always in your favor. And, you get a positive diplomatic benefit to your replutation with your ally, since you joined together against a common enemy.
When I'm at war, I like to have as many allies as I can. The only exception here is if I think the ally has the military strength to take cities I want before I can snag them.