When exactly did removable RAM stop being a thing on the 21.5" iMac? Wasn't it when they changed design in 2012? Or was it with the move to the 4K panels? If it was the design change, the new one is thinner. If it was with the 4k panels, the screens and components related to screen control produce slightly more heat. I'm not saying the business aspect didn't play into it, as is obvious with the Mac Mini. However, in defence of the Mini, I wager that has more to do with production optimisation than it does requiring consumers buy RAM directly from Apple, since I wager most people did that anyway. Even though swapping RAM is extremely easy and trivial, most consumers don't even bother with the easy. And if all the other computers used soldered RAM it's easier to move more of the production over to a similar style.
It was with the late 2012 21.5" iMacs that memory was no longer removable and consumer-replaceable. I know because I had one (purchased in 2013) and it was really frustrating not being able to upgrade the RAM myself. It also maxed out at 16GB RAM anyway, even if ordered BTO from Apple.