With Yao Ming back and Brad Miller now in the mix, Houston needed to thin out their front line. So they basically paid Toronto to take him off their hands. Which, ironically, is sort of how they ended up with him in the first place.
Toronto picks up the Australian center plus some cash for the price of a second round pick headed back to Houston.
Andersen was actually decent solid in the limited minutes he got last season, playing in 63 games and giving the Rockets 5.8 points and 3.3 rebounds per game. He has a fantastic turn-around jumper from the block and shooting range all the way out to the three point line that you have to respect. However, he struggled defensively. So he should fit in fine in Toronto.
Andersen ended up with the Rockets because the Hawks struck a similar deal last year, essentially paying the Rockets to take him off their hands.