The person taking the loss gets to write it off of their taxes, that's why they person getting the benefit has to pay taxes on the money.
What would you rather owe, $40,000 or the taxes on $40,000?
The taxes on them. I'm just making the point on how the IRS is an enemy within our borders...a consumption tax would avoid this issue entirely. However, this isn't the thread for that.