It's because they need the headcount to speculatively try to achieve the growth numbers needed to support their valuation.
Suppose they cut back to just keeping the lights on in engineering, along with obviously-profitable sales staff to sell advertisements and make business deals. Twitter is instantly profitable, but the net present value of those cash flows is something like a third to a tenth of their current valuation.
This is what happens when you over-fund a business at too high of a valuation. They do what they can to try to "grow into" the valuation, because otherwise management's junior equity positions and stock options are worthless.