He didn't go in to kill a kid or anything like that. His intent wasn't such, he only reacted for a fraction of a second because of how dark what he saw was. He flicked the switch in a moment of pure impulse before being hit with immediate regret. Had Ben not woken up in the worst possible moment, things could have been different, but life's like that sometimes.
Luke was in an entirely different place back during the events of the trilogy. Back then, it seemed like life could only get better from a run down Rebellion in a dominated galaxy to something more. But now Luke's older, and their happily ever after is showing signs of cracking. The Pendulum is starting to swing the other way, and Luke sees what could destroy everything he spent years of his life fighting for...and has that one human moment of weakness, to take the simple route. He regrets it, because he knows that's not who he normally is, but that moment costs him hard, costs him everything he's built. That vision of the future becomes self-fulfilling. All that hope, optimism, hard work, it's all shattered in a moment of weakness.
It's not bad in the least, it's one of the best moments in Star Wars. It lets Luke be more than the perfect hero to render the new characters pointless. It lets Luke be an actual character, with flaws and all, but also growth, and the means to better the galaxy in a way that better fits the Jedi than some sort of Force God to solo the First Order.