Sanchez is in the midst of a horrible season, posting an ungodly .556 OPS, but he had decent years as the Marlins' regular first baseman in 2010 and 2011, and he's only 28. And losing Hernandez, a brilliant defensive outfielder who can't hit at all, isn't worth worrying about.
Still, it seems strange that the Pirates would give up what is basically a first-round draft pick -- it's unclear exactly which pick it would be in next year's draft, but it's probably in the mid-30s -- for a player like this. Sanchez will probably help the Pirates' bench, but the Bucs already have a first baseman who's perfectly capable of hitting lefties, which is the one thing Sanchez does very well on offense, in Casey McGehee. (McGehee has been bad so far this year, but a lot of that is that the Pirates have asked him to play too much against righties.) The Pirates must feel Sanchez has some bounce-back potential; we'll see.
UPDATE: The Pirates have also acquired minor-league reliever Kyle Kaminska in the trade. I'm guessing they'll send him to Class AA.
For more on the Pirates, check out Bucs Dugout.