Typically a sign and trade is a maneuver that is used by teams and players to allow a player to make more money than he would have otherwise been able to make by just signing a contract with his new team. NBA teams (particularly the ones like the Heat and Lakers that have several max contracts), live on the edge or even past the salary cap, so there are serious restrictions on how much they can pay players acquired in free agency. Sign and Trade is a way to allow these players to make the money they have earned, and allow teams with max contracts to actually fill out their rosters (and make competitive offers to appealing free agents like Nash).
In the case of the Nash trade, the Lakers would only be able to offer him a starting salary of (likely) about 3 million through the mid-level exception. However, by trading for Nash they are able to use the trade exception they received last year for Lamar Odom to account for Nash's salary. This allows the Lakers to pay Nash 27 million over the next 3 years. In contrast, Toronto has salary cap flexibility and offered Nash 36 million over 3 out right. Sign and Trade allowed the Lakers to make a competitive offer to Nash rather than a pittance of the mid-level exception. Nash weighed the opportunities (better team, closer to his family in Pheonix, leaving the Suns with some assets) vs cost (giving up $9 million in the next 3 years, getting to play in his home country of Canada) and decided that the Lakers were the better deal. (source)