First off, Hanley is one of the highest paid shortstops in the history of the game, and the rest of his contract comes with some hefty paychecks:
2012: $15.00 million.
2013: $15.50 million.
2014: $16.00 million.
2015: Free Agent
The Giants have little wiggle room with the budget they've allotted themselves already, and with them trying to lock up Tim Lincecum and Matt Cain to long term deals, the money might simply not be there.
Second of all, Ramirez has come to have the reputation of being a bit of a 'me' player that needs an occasional attitude adjustment, while the Giants have been preaching the 'we' mentality of their team for a while now. He's unwilling to move over to third base for the Marlins, a team that could end up being ridiculously stacked next season, who knows what kind of temper-tantrums he'd throw out in the Bay.
Hanley is still a great talent in the this league, but I don't foresee him wearing the Black and Orange anytime soon (unless he somehow gets traded to the Orioles).
For more on the Giants, head over to McCovey Chronicles.