Walls and doors are classified by the IRS as physical plant and have to be depreciated over 49 years. Cubicles are office furniture and can be depreciated over, I believe, seven years. That’s the real reason nobody gets an office anymore. It has nothing to do with productivity. If anything, the noise and distractions of a cubicle environment reduce productivity.
Flexibility is probably far more important than anything else. More and more companies are migrating to a flexible work space model where their employees don't spend all their time in the same place.