Because Zangoose and Seviper are, in their Pokédex entries, natural enemies, it makes sense they would attack each other. Because there was more Zangoose that Seviper, the Zangoose attacked it until it fainted. It works the same way if a Corsola calls a Marinie in an sos battle. The Marinie will attack the Corsola.
Also, that’s just how it’s coded.