What Lorca told Mudd is not necessarily what Lorca told Starfleet. Probably similar, since he didn't have any fear of Mudd or Tyler spilling the beans, but it's all but certain Lorca was trying to intimidate and out-psycho Mudd, so leaving him with the impression that he believed strongly enough in the concept of "a fate worse than death" to put that into action with his own beloved crew was in his interests. He was telling Mudd, "I've killed people I liked more for less reason."
The version he told Starfleet was probably much more noble-sounding. The ship is wrecked, much of the crew is dead, the Klingons are closing in, maybe boarding parties are already rampaging down the corridors. Lorca bravely activates the self destruct, his first officer slugs him when he refused to evacuate (since the Klingons will shoot down any escape pods) and throws him into a shuttle at the last possible second, leaving him half-dead and half-blind, limping home.
(This would all be a lot cleaner if Landry had also been replaced by her mirror-universe counterpart, giving him a natural co-conspirator. It's slightly odd that the PT version is the more obsessive and brutal of the two. On the other hand, if Lorca saved her, that could account for her personal loyalty, both in that she owed him her life, and that they might share a secret about how craven their escape really was.)
As for getting command of the Discovery, that's the simple part. Lorca was tight with Mirror-Stamets, and knew his research could allow travel to alternate universes. "Mushroom drive" sounds, frankly, ridiculous. It's exactly the sort of rear-action boondoggle where Starfleet would love to stick a suspiciously-sane Captain who had just experienced a major loss when they'd be hurting for officers; somebody has to captain the fungus-farm, and it just so happens that the only person who actually wants to be on that flying joke is also someone you'd rather put on psych leave if he'd just give you an excuse, freeing up another captain to run missions that aren't a total waste of time. Lorca volunteers for the DASH drive project, reveals a hitherto unknown enthusiast's interest in astromycology, and specifically asks for the less-likable of the two scientists working on the project. He fills out his crew with people who had a black mark from the Shenzhou (because he's setting up to build a rapport with Burnham), who would likewise be seen as undesirable by most of the fleet.
And then once the spore drive works, Starfleet immediately starts elbowing Lorca in the ribs, encouraging him to maybe take a vacation, sips some jippers on a beach, and let less someone slightly less creepy and angry command what just went from being the least important posting in Starfleet to the most.