It is just a necessary evil. There is nothing that could be done about it. We couldn't hold onto and enshrine everyone. Martinez was/is fantastic, but there is no way that you can hang onto him and not get value when you can with the rebuild.
The Kings already had more than most teams that were locked in core guys with Quick, Doughty, Kopitar, and Brown. Even then, we aren't 100% sure that they will all be given the same opportunity to retire as Kings as Brown did. That also requires a bit of luck in contract timing pairing with the decline of play and lastly the player having the wherewithal to accept the writing on the wall and choose to hang them up. Kudos to Brownie for being the big man in the room and pulling the cord himself and not dragging it out and forcing a kid to hit waivers this year, etc.
Dealing Marty, Muzzin, Toffoli, etc. are just something you cannot and should not avoid. These are mistakes that Lombardi made. It is a business, we want to remain competitive and get back in the race, and showing loyalty of that level can bite you. They can always come back later in another capacity. Jarett Stoll didn't retire a King...
It also should be noted that the trade helped us get Lias Andersson and Francesco Pinelli and also gave us the flexibility to use Toffoli's picks to leverage for Brock Faber ---> Kevin Fiala.