Apparently, Joba was more upset about the 5th starter role than he let on publicly. There's talk of a few players being added to balance the deal out, but the Pirates see Joba as having more upside than any of their other young pitchers. They don't have the money to spend on free agents, obviously, so trying to buy low on a talented young pitchers seems to be a good strategy.
I didn't believe it, but Rob Neyer was reporting rumors of this deal through his ESPN blog here, and another reputable source is reporting it here.