Bashir is a hero, no question about that.
They used it as a bargaining chip. The Federation didn't give the cure until the war was won. So they embraced S31 tactics.
Also, I think I said in another thread that I don't want to get drawn into yet one of these discussions about amoral assholes in Star Trek, yet here we are again. I think this derail should end.
You do not HAVE to reply to such posts. Own your role in the derailings.