(Warning: wall of text rant incoming!)
First of all, I hate the "Mentor must die" trope. I find the basic idea of someone who is over 60 is "useless for the plot" therefore must die, really disturbing.
I mean a dying moment for a beloved character is always painful, and I'm not entirely against a well crafted death scene. Han Solo's death in TFA did have some meaning as Kylo Ren was hesitating and was in turmoil before making the decision. The circumstances added some thematic meaning to his death. I did not like the scene itself, I think it was poorly filmed and not very well acted, but I understood what the point of the filmmaker was. It was poorly executed (pun not intended) but I got the point.
But man... what is this? Yes, Luke is well over 60 in this movie, but he is still the most powerful Force user in the galaxy at this moment (I believe he is a notch above Snoke, even), and this is what they do with him?
I don't have a problem with the idea that Luke is not perfect and had a moment where he thought he can protect the galaxy by killing Kylo. On a very basic level, this conflict inside Luke, inside Kylo Ren and the conflict between the two characters is interesting. The idea is interesting for such a conflict to occur... but the movie takes this idea and absolutely botches it. I even liked the idea of the different interpretations (Luke having crazy, rage-filled eyes when Kylo is telling the story was a nice touch) of the event. These scenes however are still badly done, and the mere fact that the breaking point of Kylo hung on this singular event is a bit of a stretch - especially that we don't know what went down between him and Snoke prior to that.
Also, a sidenote: his moment of weakness was caused by his determination to keep the people and the galaxy safe from the Dark Side, right? He wants to defend what was achieved at the end of ROTJ, which is comletely understandable. But after he survived the attack on the Jedi Academy... he is just giving up? I mean Kylo is joining forces with Snoke, creating / strengthening the First Order, killing millions if not billions in the galaxy... and Luke is suddenly OK with this? I mean does he seriously think that he would make the situation worse somehow if he tried to fight back / join the Resistance / help and protect Leia / go on a suicide mission to duel with Snoke & Kylo / or... DO ANYTHING? It's horrifyingly out of character for him to do nothing! Also, it's too similar to Yoda's solution in ESB (in EP III actually). I mean for a series that prides itself on being different from the OT, it still has similar elements when it's convenient for the writers... because of course.
I can imagine Luke being in despair for maybe a few weeks, but I think he would have snapped out of it, seeing that Leia and Han are in immediate danger as long as the First Order exists, and they (and again, of course all the other people in the galaxy) were the reason for even founding his Jedi Academy. He would not suddenly stop fighting.
And then he has his death scene preceded by some cool projection tricks. The scene on the Crystal Fox planet was great, and I understand the physical reasons why Luke died, however it was not the death that Luke would have deserved. Buying a couple of minutes for the Resistance to get away... is not a legendary act fitting his character (also, it's similar to how Obi-Wan dies in ANH, but of course it's not a problem here because of... reasons). Also, Yoda asked him to teach Rey a lesson, and... he kind of didn't. I mean Rey did not even witness the event first hand, and buying time to aid a getaway is not exactly a Jedi-exclusive thing to do... Maybe Force Projection as a skill will be useful for Rey, but Luke did not actually teach her how to do it... So I believe Yoda will be an angry Force Ghost in IX!
The character interpretation should be that he embraced the legend he has become... which thematically kind of makes sense, but from a plot standpoint he must know that he is actually the most powerful Force user, and his skills would be tremendously useful... you know, in an actual battle with the First Order. He is vastly more useful to the Resistance living than dead, but this is just such a no-brainer, I feel I'm insulting whoever is reading this just by mentioning this fact. Especially now, that Luke is aware of a really-really strong other Force user he could join forces with and guide her (learning from his past mistakes ofc). Him dying this way is just not a logical action, and this is where the writing room rears its ugly head: we know he only dies because the writers decided that they are going to use the trope I mentioned at the very beginning of my post.
In fact, the new trilogy is a story about new and young characters, so out with the old, in with the new! Literally, as in Han, Luke and Leia must die. I would rather see them helping the new characters, instruct them, guide them and maybe die but in more meaningful ways. Of course the fact that what I want doesn't happen in the movie is not a valid criticism, and I don't mean it like that, just wanted to mention it.
So actually in TFA, Han Solo was utilized OK, but TLJ just cannot fit Luke into the story that it's trying to tell. This is a story about Kylo and Rey fundamentally, and I find their characters and their storyline interesting. Luke doesn't fit in there, so he must die. They don't even try to do something interesting or meaningful with Luke. He doesn't really teach Rey ('in that case it would be too similar to ESB, hurr-durr' - well, it all depends on the execution, you know), doesn't really fight for the Resistance, doesn't really have any significant part in all that is going down... and that irritates me and I find it disrespectful.
(inb4 anyone brings it up: I did not like Obi-Wan dying in ANH either, his death was also kind of pointless, but the rest of the movie made up for it. The rest of TLJ did not make up for the above, hence my rant)