The logic behind doing that....look at it like this breh. Let's say you live in ABQ, and you're picked to be a juror in the State of NM vs Walter White.
You sit in the court room, and find out the star witness against Mr. White, accusing him of being a drug lord, is his brother in law Hank Schrader.
Who is a DEA agent.
And literally every lead Hank had in the case either died (Gus/Tuco/Hector/Tortuga) or disppeared (Mike/Krazy 8/Emilio/etc.)
In addition to this, in some of those situations Hank personally killed them (Tuco). Or, in other cases they died shortly after he met with them (Hector/Tortuga)
Now,
we know what happened. But the jury doesn't.
And eventually I'm sure they'd clear Hank's name. But by then Walt would be dead, Skyler and her kids would be ruined financially, and Hank would be unemployed and most likely hundreds of thousands of dollars in debt with legal fees.
So essentially he was playing chicken with Hank. The same way he did with Skyler, when he told her "ok, call the cops" in season 3.
Fred.