Bacco seems to have collected on the bad karma she's been collecting since she turned a blind eye to the coup by Picard and the others and the murder of Min Zife. I, for one, am glad to see that payback.
So she deserved to die? Christ, man. No one deserves that. And the Federation certainly didn't deserve the trauma of seeing its president assassinated.
Apparently you have no problem with the Federation President being secretly removed from office by the military and then later assassinated, as long as the people don't find out about it.
Did she deserve to die? Not necessarily. Did David Marcus deserve to die? Perhaps not but the writers of TSFS felt that someone had to pay the price for him using protomatter. That's what it came down to when they were deciding if it would be David or Saavik, If you break the rules then there is a price to be paid. Perhaps not by you but it should affect you.
Bacco knew that something had happened to Min Ziff and "convinced" Ross to retire because of it. Pretty sweet deal for overthrowing the leader of the free galaxy and turning him over to people that you knew would have no qualms about making him disappear. Bacco's only President because her predecessor was illegally removed from office and she did nothing about it.
I would have preferred to see the entire cabal, including Bacco, brought to trial but for various reasons the authors have decided not to do it that way. The price still had to be paid and she paid with her life.