The Giants had to do something and after Pence Beltran was probably the best impact guy they could land. Their best hitter is Huff, what with his .244 AVG, and they already have a top of the line rotation for the next few years. They could afford to lose a pitching prospect for a guy who, while perhaps over the hill career wise, is doing well this year and therefore probably a fine choice as a 2 month rental.
For the worst offense in the league, even Carlos Beltran is an improvement. Look at it that way.