It depends on the circumstances though. This situation has a lot more to it.
The Leafs are not a contender, so getting Luongo may not make sense for their long term view. Obviously upgrading goal will be nice but they are a building team and can't afford to sacrifice their young players. Also, it may not have a net benefit to take on Luongo when the team isn't ready to be competitive.
While you feel Kadri is mediocre, I can assure you that the Leafs organization doesn't feel that way and have spent considerable amounts of resources preparing that kid for the NHL. He's a proven ppg player in the AHL and has made significant improvement since first arriving defensively and physically. Is he all the way there? Not yet, but he's close to making the permanent jump to the NHL.
Kadri cannot be traded right now. Not because he's the next big thing, it's because the Leafs invested in this kid and are going to see it through. If Kadri fails to live up to that investment, then management will make a decision. That time shouldn't be now though.
You really have to take your personal bias out of the picture and look at this more holistically. It's a complex situation.