The tax code awards this behavior by offering you the ability to deduct your contributions from your taxable income if you make them into a traditional IRA.
Not all of our investments will turn out to be winners. When you choose to sell your losing positions, you can harvest these tax losses to lower your taxable income.