Neither of these players were particularly valuable.
1. Honqvist was old, expensive, and signed for three years. Pittsburgh just gave up a 1st for a forward. Someone was going elsewhere. Matheson, despite his struggles is still young and could bounce back. It was a buy low option. If Pittsburgh had more assets to trade for a better option they would have. Could blow up in their face but they needed a quality defender for Sids last few years and can't really rebuild. They still needed to get young though, which their trades have accomplished.
2. Florida needed to get rid of one of their overpriced defensemen. They've been ordered to cut budget apparently. They've been shopping Matheson with no takers for a while now. You can't say they didn't try and find a better deal out there. Hornqvist was almost certainly the best they could find. Got rid of a lot of risk with that Matheson contract, it could have been an albatross if he continues to lag in expectations. Since Hoffman and Dadonov are probably gone in order to save money, Hornqvist has an easy spot in the top-6 to get plenty of offensive minutes to juice his numbers. They'll trade him at a deadline in a few years and get a good asset probably.
I have no problem with this trade for either team. Kinda of a "garbage for garbage" trade, but not garbage, just trading one player with a list of potential issues for another one.