MagSafe wasn’t flush, no; but I don’t think this is an inherent requirement. I think it’d be possible to make something flat on both the cable and device side.
> swapping the lightning port with a MagSafe one would make the phone pretty much impossible to use while charging
How so? I used my MacBook in bed while charging with MagSafe all the time. The magnets were fairly strong. With a cable going away from the bottom of the device, I think it’d be perfectly usable.
As far as waterproofing, getting rid of the lightning port seems inevitable, because it allows for better hermetic sealing. A flush set of pins seems great for this goal, surely it’s trivial to avoid shorting something out in the prescience of liquid? (I am not an electrical engineer)
I don't remember MagSafe on macbooks ever being truly flush. It was less deep of a port than USB, sure, but it was still a port.
As for why not, there could be many reasons, but I have a feeling it might have something to do with their waterproof/dustproof rating. That's just a pure speculation on my end though.
Or, more likely, it is simply because swapping the lightning port with a magsafe one would make the phone pretty much impossible to use while charging. But with a lightning port + magsafe wireless charging, you get to have both use cases covered (using while charging with lightning, drop off for an overnight charge on your magsafe charging surface).