He knew that he'd have to face the music. He hoped for mercy.
Needa had known that death was the likely consequence of his failure to capture the Millennium Falcon. He had known, too, that he had to report the situation to Vader and make his formal apology. But there was no mercy for failure among the Imperial military. And Vader, in disgust, had signaled for the captain’s death
He was hopeful that promptly reporting his failure would earn him some brownie-points with Vader (it didn't).
An hour later, brave Captain Needa boards a shuttle that takes him from his Star Destroyer to the flagship of the fleet. As he disembarks, his stomach twists into a knot. He listens to his own footsteps echo along the glossy floors of the Imperial ship. He’s been a good captain, he tells himself. Everything will be fine.
Star Wars: The Empire Strikes Back: So You Want to Be a Jedi?
According to the Star Wars Encyclopedia, he was driven by a sense of honour
When Han Solo's ship escaped, Lorth Needa decided it would be most honorable if he apologized personally to Darth Vader. The apology was accepted in a way, as Needa was executed on the spot by Vader's Force choke.