If we remove the injected section indicated by the em dashes (-
), the sentence reads:
balance their desire to keep software flaws secret against sharing those flaws with technology companies
So the author is indicating the government services in question want to keep software flaws secret. But they do recognise that sharing them would mean the flaws get fixed and doing so would make the internet safer.
Obviously if they shared the flaws, then the flaws would no longer be secret. The debate is in which is more advantageous, having a secure internet or having known flaws that the services can exploit.
Thus this sentence uses "against" in relation to distinguishing the two sides of the mentioned "debate". You could even think of it in terms of an old style weighing scales, you may balance some amount of something, say flour, against a known weight, like a 500 gram weight. The word "against" indicates the action of comparison between the two.