There are, by necessity, other wires and ground paths that you are not describing in your question. If everything were isolated to just the two power input wires, it would not matter what order you connect them.
However, since you are experiencing these problems, there is some other path to ground through communication lines, enable pins, or the ground connection on the output side (if this is a non-isolated DC-DC converter).
Remember that AC-powered devices are referenced to earth ground. For example, if you have a power supply plugged into a wall outlet and a computer also plugged into a wall outlet, there is a ground path through the wall or (quite common) a voltage offset relative to earth ground between the two systems. Some power supplies output voltage that is actually negative in relation to earth ground; if you connected a circuit powered by one of these to a computer's USB port, large voltages may be applied to the USB supply rails or communication pins.
By not connecting the ground first, you do not have control over the voltages applied to other pins and cannot ensure they remain within specification. In systems that require hot-swapping, your solution with the protection diode is an acceptable method to clamp voltages to within specifications during the fraction of a second the connection is being made. You may want to attach similar diodes to any other control or communication pins that are involved.
In summary, ground voltages of two systems may differ significantly, or even be oscillating quickly relative to each other. Additionally, pins other than power and ground may attempt to carry power if they are the only current path available. Either control the connection sequence, or protect individual pins if connection sequencing is not possible.