It might be plausible that entering an alliance wont immediately put you at war with allies enemies, but at least you should get some relationship penalty with them. Something like "You are an ally of my enemy" -50.
Something like "You are an ally of my ally" +50 also might make sense, but I haven't seen AI allying AI.
And "You are at war with my enemy" +25.