While it may seem right from the perspective of the single treaty, if you look at the whole picture it means that you use people's treaties against them and - this is clearly the corollary that makes the entire thing fall apart - you admit that others can use your treaties against you.
Treaties are agreements that you signed for your own purposes and to support your direct counterparts. If some party that is distant in the treaty web started some conflict and you find yourself entering on this or that side depending on the order in which treaties are "activated", well... something is definitely wrong.
An alliance shouldn't let their Foreign Affairs be dictated by those that can best manipulate the treaty web, but they should rather operate with their objectives in mind. This isn't necessarily "realpolitik" - you can still pursue an honourable and "losing" stance (or whatever else you fancy to role-play) - but it's just self-determination: you do what you want to do, you defend/attack what you want to protect/destroy.Your true allies will understand when you can't help them (or rather: their allies) because it's incompatible with your decisions.
In short: your treaties are yours, not anyone else's.