Are they likely to do this with the iMac, to make sure they get all the extra cash, or is it more likely that they did it in the rMBP due to space limitations?
Not very likely. The iMac doesn't have MBA or MBPr constraints.
The primary motivation to make the case less than 0.8" thick. It is extremely unlikely the will want to do that in a iMac. An iMac uses a desktop processor and a substantially (if not 2x ) hotter GPU. Trying to push the iMac into the sub 1" thick is just delusional. If Apple goes that route then the iMac is a skip because the inmates are running the asylum at that point.
The current iMac runs 7.42-8.15 inches thick (including the base ***). Thickness, even if they foolishly trim off an inch, isn't a problem. It seems more likely Apple will shrink the panel thickness, which would result in a marginal thickness reduction. The air/cooling gap between the logic board and the monitor would likely remain the same. (Thinner panels doesn't mean the panel and/or the board get cooler. ). As long as the gap is there the SO-DIMM memory should be OK.
The other mitigating factor is that the RAM is located below the "chin" . Unless Apple extremely gratuitously tapers the edges, there is space there. That is kind of silly since the vents for cooling also depend upon those edges.
Besides horizontally mounting 32GB would be extremely wasteful use of horizontal space. The MBA and MBPr waste horizontal space in order to get less thickness (or constricts memory to relatively low levels for 64-bit computing.) That anorexic limbo doesn't come without a cost. The iMac really doesn't have buckets of wasted horizontal space to recklessly throw away. The thinness doesn't "buy" that much to make up for that damage.
At the end of the day the iMac does have to compete with Windows PC boxes that aren't shooting themselves in the head. And if they cripple themselves into being equivalent with MBP/MBA then those too with increasingly cannibalize them.
If Apple was deliberately hostile I suppose they could take away the room to use SO-DIMM. But it doesn't make any sense as they just creating deeper and more complex thermal problems for themselves. Trying to hustle to sell more RAM is kind of dubious when already bundling LCD panels. They have already locked up healthy profits right there. Greedily hustling on top of that for some incremental RAM margins is only short term effective. Longer term they'd be killing off the iMac because it was substantially less competitive against the alternatives.
(***) It really doesn't buy much to make shrink the main iMac body back 0.5-1 inch or so more behind the foot it rests on. If chasing Retina hype then moving the display further away just reduces the need.