I always thought that if an expiring contract was included by some draft picks in a trade proposal, it seems attractive to a receiving team. Is it just about draft picks? Or there is another benefits in acquiring a huge expiring contract like Emeka Okafor's contract?
There are a couple of advantages. If the player is a restricted free agent at the end of the season, the player has little ability to sign with another team. That's because the team he was on when the contract ended can match the offer he accepts from another team in order to retain him. I know in some cases a player at the end of his contract may be acquired to make a push for a championship that season. It can also be to free up money for the following season. There could be multiple reasons for acquiring a player at the end of his contract. In the case Emeka Okafor I'm not sure since I do not follow basketball too close.
It's pretty much all about clearing salary cap room:
Sometimes teams get locked into long-term financial commitments from which they later want to extricate themselves. Typically this is when they have players with expensive, long-term contracts, but have no real hope of competing for a title before those contracts run out. These teams usually have little hope of having cap room to sign free agents, and may be facing large luxury tax payments as well (see question number 21). But if such a team were to trade a high-salaried player for a player with a similar (or even higher) salary who is in the last year of his contract, then they would be able to rid themselves of that financial obligation the following summer. This could get the team below the tax level, or possibly create enough cap room with which to sign a productive free agent.