In this case the engineering choice was probably driven at least in part by the desire to take advantage of the T2’s line rate encryption features, which so far has never been supported on removable/upgradeable storage mediums (at least as far as I am aware - the T2 drive encryption is a separate feature from FileVault, which is supported on removable media). Even on the iMac Pro which technically has removable flash storage, to my knowledge no one has yet managed to produce a T2 compatible after market third party upgrade.
Thankfully thunderbolt 3 removes much of the advantage internal storage media traditionally enjoys, at least in performance terms, so there are reasonable upgrade paths.
This is a choice, not a hard engineering limitation. An m2 SSD is tiny even compared to a single 2.5” drive.
https://i.imgur.com/dW0ynV7.png
They can also be mounted at an angle just like those SO-DIMM slots.
The M.2 standard even supports 12mm, 16mm, and 30mm width modules in addition to the 22mm that seems to have become the norm. Apple could still be a dick by using a 12mm or 16mm card while still supporting the standard.
Stand-off M.2 sockets are a standard part, because a number of mainboards put components under the M.2 slot.
I think there'd easily be room, given that the soldered-on NAND chips could be removed from the board.
edit: If you're wondering how that works, here's a hint: https://raw.githubusercontent.com/ThomasKaiser/Knowledge/mas...