While I agree that this should be possible, I am for having this as a separate treaty that has the prerequisite of Ally status.
Oh, yes, I would love to see that implemented as a Diplomatic option, too. But with the current shallowness of diplomatic interaction and the fact that Alliances is really, really far down the tech tree for some reason, I don't know how much of an effect such a change would have.
I mainly just wish alliances played a bigger part in this game in the first place! It's so frustrating that the AI never really gangs up on you and alliances can't be formed until well into the mid-late-game. I have no way to meaningfully "team up" with anyone until that point and, even then, it's still a bit stunted in terms of cooperation.
Also, why is there no option to enter into a joint military alliance against a third party? I know you can bribe people to declare war on someone (basically by promising to declare war on some other random player, otherwise it's too expensive), but there's no way to make a "I'll join in an alliance against this guy with you" deal wherein the value is shouldered equally by both parties, making it not 1000+ influence to become acceptable.