The purpose of the wash-sale rule is to prevent investors from selling securities at a loss for tax purposes while still maintaining their original investment position. The rule prevents investors from unfairly reducing their tax liability. It helps ensure that investors pay their fair share of taxes while still allowing them to invest in the market.