In Doflamingo's first appearance, he made two WG agents fight each other right at Mariejoa in front of Sengoku and got away with a slight scolding. The WG expect the shichibukai to act the way they do and are okay with it, so long as they are still worth a a lot to the government. It's not betrayal so much as incomplete loyalty that everyone is aware of. And even if Hancock went a bit over the usual pushing of buttons, the marines still won the war, so they're probably willing to overlook relatively minor insubordination.
You mean the same World Government that sent a hit out on Moria after the end of the war just because "he was useless" and they wanted to off him in a dignified way where he lost in battle rather then government assasination? Marines and Shichibukai are pawns for the World Government. Sengoku puts up with the Shichibukai because they are considered integral to the WG and he can only file complaints. The WG is now starting to see some of them as useless (not the marines, they may have already thought they were too much of a hassle). All bets are off on their future especially after the debacles that certain other shichibukai did during the war before defecting (blackbeard and Jinbei). This completely ignores anything else about Hancock and what she did to help Luffy in Impel Down and during the war. She didn't help, she showed up because she was forced to, Moria did more in the war to help then she did and he still got the axe.