In The Empire Strikes Back Darth Vader has little to no compunction toward executing screw-ups such as Ozzel and Captain Needa, but at the end when the Millennium Falcon escapes to hyperspace despite Admiral Piett's assurances the Falcon's hyperdrive was sabotaged Vader simply walks away. Why did he let Piett live?
It was probably not Piett's fault, and Vader recognized that. Vader had been in personal command of the imperial forces on Bespin, while Piett remained aboard the Executor, out in orbit. There is no reason to think that the order to sabotage the Millennium Falcon had to have been relayed through the admiral; Vader could just have told some of the imperial personnel that that he had brought down to Cloud City with him to take care of it. They would have completed the job, then reported that fact back up their normal chain of command—ultimately up to Piett.
Moreover, it is clear from the original novelization of The Empire Strikes Back that Vader already considered Admiral Ozzel to be a liability, even before he screwed up the approach to Hoth. (This is implied in the film as well: "You have failed me for the last time, admiral.") Simultaneously, the dark lord recognizes that Piett is a talented officer, and while Piett is captain of the Executor under Ozzel—and thus the next-most senior naval officer in Vader's taskforce—Vader does not promote him solely because he is next in line, but also because Piett has proven his effectiveness. Vader presumably knows that he cannot execute every talented officer, every time they make a mistake.
Finally, Vader may be less likely to punish his underlings' errors so severely when they come right on the heels of his own failure. Catching the Millennium Falcon with the tractor beam was an emergency backup plan. The main plan to capture (and freeze) Luke had failed, and that was nobody's fault but Vader's. In the last few shots of the Executor bridge scene, Piett looks shocked and scared, but Vader just strides away—with a slower, less purposeful walk than usual—knowing that the failure to capture Luke was overwhelmingly his own fault.
This is addressed in the film's original junior novelisation. Vader doesn't kill mindlessly and he doesn't kill flunkies who've done nothing wrong.
Maintaining his slow stride, Vader glanced to his right and barely noticed Admiral Piett. The Sith Lord could practically taste the Imperial officer’s fear, but as angry as he was at losing Luke, he knew that Piett — unlike some recently deceased Imperial officers — was not at fault. Vader had much to contemplate, so he looked away from Piett and kept walking.
Without a word, he left the bridge.
It wasn't Piett's fault that R2 repaired the hyperdrive. Vader asked him if his men "deactivated the hyperdrive", in that sense he did exactly as he was asked to do. Now, if Vader asked Piett to have his men "destroy the hyperdrive" and they instead disabled it, then perhaps he would have a reason to kill him but in this case all they did was temporarily damage the hyperdrive which R2-D2 was able to later on repair. There was no failure on Piett's part, they were bested by a force with superior knowledge of the Millennium Falcon.
TLDR, it's all about Vader's character arc.
Talk about having a busy movie! He has learnt that he has a son, faced him in mortal combat and in a moment of madness, betrayed the Emperor only for Luke to emphatically reject him. Finally Luke has acknowledged him as father, confirming the bond between them.
By the time the Falcon escapes the dynamic has evolved. The original, failed task of capturing Luke has become obsolete and there are new, more powerful considerations in play which will be explored in Return of The Jedi.
Vader’s character has fundamentally changed with his interaction with Luke. He is ready to take his first steps towards redemption and it is no longer suitable to show him cruelly dispatching underlings.
He is also distracted, and with so much to process at this singular moment even Jar-Jar Binks would be safe in charge of the Imperial fleet.
Piett is there on the screen to help us observe these changes in Vader, right up close and personal.