Details of trade:
Golden State receives - Marcin Gortat, 2nd round pick
Phoenix receives - Harrison Barnes, Andries Biedrins, 1st round pick
Why the Suns do it - Phoenix needs to get rid of their older players and fast. It will also help develop the younger players and kick-start the rebuilding process. Harrison Barnes is a solid pick-up for Gortat, who will help in terms of long-term success. The draft pick, which should be in the 20s range, will also help. Biedrins contract is horrible, however Suns have cap space to spare.
Why Golden State does it - While Barnes is a good rookie, he is expendable and is not really showing star potential. They are surprisingly good, without a true center currently due to Bogut's injury. Also, even if Bogut comes back and recovers fully, Marcin Gortat would be a great back-up / insurance option on a relatively cheap contract.