"In 2008, the IRS issued Revenue Ruling 2008-5, in which it addressed the question of whether the wash-sale rules apply to IRAs. In this ruling, the IRS explained that when shares are sold in a non-retirement account and substantially identical shares are purchased in an IRA within 30 days, the investor cannot claim tax losses for the sale, and the basis in the individual's IRA is not increased."
But the wash sale rule is easily circumvented by, for example, replacing SPY with DIA, or selling otm puts on the exact same stock you just sold.