excluding trauma care for accident victims (that end up dying anyway), and excluding cases of early-in-life cancer, and excluding every other case we can think of where a spike of medical spending shortly before the person dies anyway is understandable as part of a good faith effort that had a reasonable chance of prolonging their life for many years, after all those exclusions are made we will still find many instances of cases where the end-of-life medical spending seems excessive.
The canonical example I can think of would be organ transplants for very elderly people. A new kidney for a 75 year old person in advanced renal failure is unlikely to prolong their life by very much.
This kind of stuff gets very emotional and very political though. This is what provoked the demagoguery about "death panels" when Obamacare was being debated in congress in 2009. We are both very uncomfortable allowing the government to make those decisions and also very uncomfortable allowing private insurers to make those decisions. We want to empower families to make those decisions and so remove cost from their consideration (via regulation, requiring insurers to pay) and then we become surprised when people who haven't made their peace with death are willing to spend any amount of money (which is a hidden cost from their point of view) to prolong end-of-life. It shouldn't be surprising. We set up a perverse incentive structure and locked it in place with regulations.
Edit: ObXKCD: https://www.xkcd.com/931/ (Lanes) Every one of those lanes going off to the right is the end of healthcare spending for someone, but you can't know going in which ones are going to turn off. Focusing on the "50% in the last 2 years" number is a lot like the the naive visualization at the top.