I'm sure you remember ROTJ. What do you think Luke was doing when he yelled out, lit his lightsaber, and started swinging wildly after Vader threatened to turn Leia? Did Luke have murderous intent with those swings at his father, or was he just playing patty cake?
In Ben's hut that night, if Luke sensed his nephew's corruption (corrupted enough to slaughter his fellow students minutes later, eventually be capable of killing Han, and even help orchestrate the murder of billions of others), what is so objectionable and out of character about Luke having a *very brief* dark thought that he immediately felt ashamed for even thinking?
The point is that Luke didn't act on that brief impulse. That's the takeaway. He saw the potential horror (much worse than that of Vader turning Leia to the dark side) and chose to let his nephew live. Luke was always impulsive, but ends up doing the right thing. It was no different in TLJ.
Why show this pivotal, critically defining moment as a brief backstory flashback?
In ROTJ we see everything - the leadup, the precise context, the moment itself - so can fairly judge the act.
It always amazes me in TLJ they chose to show all of this rich, emotional stuff - Luke encountering and then training Han and Leia's son and what all of it leads to - as these ultra brief flashbacks. And instead, in its place, we get what we get as the A-story.