On a laptop I understand the removal of the optical drive, on a desktop....not so much. At least not just for the sake of making it smaller. If it means you add a HDD/SSD, OK. But just to save 1/2 inch? Why?
Causality is likely backwards here. The ODD is dropped ( because it is legacy media tech Apple is leaving behind) then the space is dropped. Once devices dropped from the edges then can save space on what is essentially now empty. The iMac as a whole isn't thinner. The internal area were they are not trying to stuff fans , ODD , etc is thinner.
Likewise if large fraction of the laptop users need the ODD, then dropping it wouldn't make sense on it either.
Folks who need an ODD can buy it, plug it in, and they are done. What makes no sense is to make 50+% of iMac buyers buy an ODD if they either aren't going to use it or use it 2-3 times a year. The justification for making folks who don't want or need it buy it is what is more deeply lacking in justification.
, made it thinner (which is of no benefit for a desktop),
pure empty space enclosed by a box isn't necessarily useful either. (even more so if not dealing with arbitrarily powered devices being inserted inside the box. )
The iMacs weight less. Cheaper to ship and lower greenhouse impact when do ship them. Weight in the aggregate of 1-2M units is actually significant.
and increased the cost. Shocker, its not selling well.
Cost and competitiveness , not the ODD, is what is the problem. Dell and HP aren't busying shooting themselves in the foot anymore with self generated FUD. [ Dell's move to private isn't a muddled mess anymore and HP isn't wandering with CEO and strategy changes. ]
There are some indication that Apple has been drinking their own kool-aid about price insensitivity of the folks they were selling too. In 2010-2012 Mac sales expanding while other PCs vendors were sliding backwards seems to let some self-delusion creep in as to Apple being able to walk-on-water. The same core forces were coming for them, it just hit later because they were skewed toward the higher end of the PC market.