Luke basically had to shoulder the jedi order being rebuilt. he was doing really good, he found a lot of old books, learned a lot of stuff. he took kylo under his wing but kylo had a lot of dark side stuff influencing him. luke was doing his best but realized, horrifyingly, that if kylo was allowed to live, the galaxy would burn and many of the people he loves would die. So, in a moment of weakness, luke felt the most rational thing to do would be to kill kylo. in that moment, luke basically felt like he had defeated himself. 'it was gone, fleeting' as he said in the movie, and had immense regret for even thinking like that, to no longer hope, but to rely on pure instinct. Seeing himself as the reason for why kylo inevitably turned to the dark side thanks to his slipping of morals, he isolated himself. this also coincideded with him learning a lot about the jedi order that backed up his beliefs. /