They trade for him because GM's still give talent/skill-set (what we all think a player can do) more weight than metrics that measure what a player is actually doing.
I'm no Bargs defender, but he does have talent. He can dribble. He can shoot. He can pass. He can defend in the post one-on-one. He *can* do all those things, even though he's been doing them awfully poorly. He's a lot more talented than Novak, even though Novak's been maximizing his talents with actual production. GM's always believe they're the ones who can make an underachieving player productive by putting him into a new situation.
Not defending the move for the Knicks, but I'd guess that's why they made it. In theory, you always want to add talent.