I'm talking BNW here: this will be significantly different than G+K or vanilla...
I think it is a matter of doing the math...
First of all, this choice is an all-or-nothing option : if you declare war to more than 2 city states you are considered a CityState agressor, and if you attack 4 all city states will rally together an be in a permanent war with you.
Hint: I haven't checked, but I think this doesn't hold true if you declare war to the civ the city state is allied with. So by attacking the major civ I think you can attack and annex/puppet the city state without this penalty.
Second: from the industrial era on, the city states you are allied with will make for votes in the world congress. Other civs may propose some very nasty rules, like ban a resource you rely on economically, or ban trade to city-states and you are at war with everyone, making your economy go to ashes...
Third: Some city-states bonuses may or may not be of importance strategically... For example, if you have a maritime city state as ally and you have 12 cities yourself, they will generate lots of food to keep your cities growing. At the beginning of the game, to ally a religious city state may allow you to choose your religion bonuses first. If you are striving for a cultural victory, the cathedrals are the only buildings besides the palace itself and world wonders that can hold Great Artist's works of art before architecture...
Fourth: There *are* situations where war with city states may be worth your while. One such situation is that, due to the city state placement, your empire may be literally cut in half by a city state with hostile personality: it get's too expensive to actually ally with them, or there are civs (like the greek, or siam, for example) that are competing for the favor of that same city-state...
Personally: I always strive to make them allies: I think the advantages greatly outweight the disadvantages of not doing so. However, that may not hold true if you are in an early conquest rampage. And, remember, one to three annexed city states are "free"...