Prior to 2014, the iMac display panel used a standard DisplayPort 1.2 interface internally, so it was probably fairly straightforward to route an external DP signal to the panel. However, because displayPort 1.2 can't support 5k over a single cable, the 5k iMacs used a custom internal interface which, I guess, would have made external DisplayPort support rather more complicated. Plus - at the time, there was no external connection that could support 5k over a single cable.
I'm not sure that the 5k panel supports any mode other than 5120x2880@60Hz anyway - all the iMac resolutions are "scaled modes" that use the iMac's GPU to re-sample the image to the panel's native resolution. I expect the same is true of the 4096x2304 display in the 4k iMac. So they'd have to add in all the circuitry to upscale external 1440p/1080p/30Hz etc. signals to 4k/5k to make it useful.
Theoretically, they could do better now that the latest TB3 interface supports DisplayPort 1.4 & single-cable 5k (...but then maybe the next re-design will go for higher-refresh rates and stick with the nonstandard interface).