Wages are a type of expense, and as with all other expenses there are many rules about what can be deducted directly and fully against income in the current tax year, what must be capitalized/depreciated over multiple years, and what cannot be deducted against income at all.
The two main different treatments the IRS calls for depends upon whether the business is considered as a form of manufacturing or mining business, in which case labor must be further classified to decide how it is included in Cost of Goods Sold (direct, indirect, etc) and Inventories (link to the IRS), or not - in which case the expense must be classified as capital expense, deductible expense, or disallowed (ex: personal expense) (IRS link, same page as previous).
What is very important to understand is that the difference is when an expense is accounted for and in what years the costs are subtracted from income, and thus able to reduce income tax obligations. It will be counted as an expense and thus reduces taxable income regardless (so long as it is not a disallowed form of expense).
Lets demonstrate this with a little example, based on the OP's example.
Deductible (Immediate) Expense Version
Year 1: Company spends a total of $100,000 digging holes and filling them back up again as a marketing ploy for another company, which can be all on wages or a mix of wages and tools that are only expected to last a year, and gets paid $100,000 for providing this service. There is no long-term asset produced and the tools are not considered capital expenses because they aren't expected to last beyond a year, so the net taxable income for this company is $0 this year.
Year 2: Company is paid $100,000 for use of their hole-digging ploy, but thanks to Photoshop they don't have to dig any more holes, so they have no expenses this year. The net taxable income $100,000.
Capital Expense Version
Year 1: Company spends $100,000 to construct an apartment, and starts to rent it out. We will ignore the cost of land, because that cannot be depreciated according to the IRS. IRS rules generally consider an apartment building to last a long time, so they have you deduct the expenses over 27.5 years - so you can deduct around $3,600 a year from income in this case.
To keep things even, let's say they made $100,000 in rents (somehow) this year. The taxable income at year end is 100,000 - 3,600 = 97,000.
Year 2: The company collects another $100k in rents, but there are no new expenses (magic). They still take depreciation on the asset, so at the end of the year the taxable income is again 97,000.
Alternate Year 2: Now, lets say the company wants to not pay so much in taxes, and decides to instead spend more money instead so they have something else to offset against taxes. If they spent $97k to dig holes and fill them back up again, as with our other scenario, their tax bill will now be 0! But of course, that's because they made no profit - not a smart business move.
So instead they spend $100k to build another apartment, but again they are not allowed to expense all these wages because they were applied to a capital asset, and thus now must be capitalized. So they do get to reduce their taxable income by an extra $3,600, but that's it.
If they had bought another apartment instead of spending the money on wages, it wouldn't matter - that's still a capital expense and must be depreciated, not deducted all at once in a single tax year.
Bottom-line: Wage are absolutely not always able to be deducted from income entirely within a single tax year - sometimes they must be capitalized. The exact rules and requirements are quite complex and vary by business and activity, but in general IRS Publication 535, Business Expenses provides a lot of guidance.
Note that in the above example I avoided stretching projects out into multiple years to keep things simple. In the real world (and the OP's example) costs and income spread out into many years, which means that the tax treatment actually depends upon the accounting method used, and the IRS allows multiple forms and thus alternate ways of calculating yearly income and expenses. For those interested, check out Accounting for Construction Contracts - Construction Tax Tips by the IRS - there are many nuances and some even exist purely to serve the construction industry, and as their worked examples show this can wildly change the taxable obligations.
For real-world scenarios, of course, you should consult a tax professional familiar with these sorts of situations to choose what way of structuring things works out the best for you.
With that said, it is important to note that there are many choices of how to structure transactions like this, so that in the real-world often multiple companies are used so as to take advantage of varying tax treatments and accounting systems - sometimes legally, sometimes not so much, but it is safe to say that there are a lot of highly paid professionals who make their living figuring out how to use all the existing rules and options to minimize tax and maximize realized profit. It just isn't quite as easy as using wages to make something vs using that money to buy something someone else has made.