He was traded when Keefe was in charge. Keefe gave him 4 games (which is 3 more games than a much better player in Korshkov received), he was clearly out of his depth in the NHL, and Dubas found an opportunity to get a guy with a lot more upside and skill in return for a guy who was likely going to be non-tendered after this year. If anything this was more about Florida giving Malgin a chance to compete elsewhere (and Malgin always dreamed of playing for the Leafs or Habs), since Quenneville doesn't like guys like him in his bottom 6 and he wasn't going to crack their top 6.
If we are really all that upset about losing Marchment, we literally have 6'6" Brazeau in the AHL we can sign at any time. He is a lot more skilled and has the same kind of issues (has size but lacks physicality, skating needs a ton of work, not great in his own end, etc.). Or we can go for a better, more well-rounded and versatile version in 6'5" Hudson Elynuik. He is actually good defensively and is a better skater, but has similar offensive upside.