The tax code strives to minimize distortions (except insofar as they are deliberately introduced). That is, it seeks to minimize how much the existence of the income tax changes people’s economic conduct.
To minimize distortion, the income tax must accurately compute “income”—the actual increase in wealth. Depreciation is part of that. To compute income, the net increase in wealth, you need to subtract costs from revenue. When you buy an asset, your wealth doesn’t immediately increase or decrease—it simply changes form (from cash to an asset). The actual cost is the depreciation on the asset, which occurs over time.
Say you buy a delivery vehicle for $50,000. In the first year, you make $100,000 in revenue and have $20,000 in operating expenses. What’s your income after one year—the actual change in wealth? You have $80,000 in cash after operating expenses, plus a vehicle that you can sell for maybe $40,000. So you have $100,000+$40,000 in cash and assets in minus $20,000+$50,000 in cash and assets out, for a $70,000 increase in wealth.
Calculated another way, you have $100,000 in revenue-$20,000 in operating expenses-$10,000 in depreciation = $70,000 in income. Now, over say 5 years, you’ll depreciate the full $50,000 cost, and the total dollar amount the IRS gets will be the same. But it will get more taxes in the first year, which due to the time value of money is worth more than getting the money in subsequent years.
For clear, fixed assets this is a quite reasonable approach, although in some categories the depreciation rate isn't an accurate model of reality.
The problem is those of us who deal with code only rarely are actually just building a vehicle. It's an ongoing activity that more resembles maintenance than the outright purchase of an asset.
Look at how much software is going to a subscription model. That only makes sense if there is ongoing improvement to the software.