I get the NMC issue, but it's almost arbitrary.
Any upgrade to Boston's D corps is going to mean someone the Bruins value gets exposed in the expansion draft. To me it's worth it for a D who can play top pairing minutes. Would I prefer someone younger? Sure. But, the Bruins do not have the assets to acquire a younger proven top pairing D without dramatically weakening the current roster. Hanafin has done little to prove he is capable of carrying the load against top lines night in and night out. Sergachev would have been great but he is off the table. In either case, the Bruins would have sold the future as well as present (Carlo+) to bring them in - and STILL the Bruins would end up exposing a young, up and coming D (Gryz) in the process.
In the case of Keith, you are undervaluing him. He is still a de facto top pairing D at a manageable cap hit. He led CHI playing 24 minutes last night and, to me, doesn't really look like he has lost all that much. The team around him is NOT good. There is a cost for that sort of player, but hopefully not the sort of cost that removes any chance of re-tooling in 2021 and beyond.
Bottom line, if you are worried about exposing D to Seattle, then you have to make peace with this current D corps. OR acknowledge that there are different ways of doing business...like offering assets for SEA to lay off Gryz in lieue of a Moore.