Resistance can be defined as the ratio of the Change in Voltage (ΔV) to the Change in Current (ΔI).
So When a Change of Voltage of ΔV is applied at a terminal, a change is current of ΔI is measured and by taking the ratio, we get
R = ΔV/ΔI
If we consider the Transistor Equation, Id = Kn(W/L)(Vgs-Vth)2(1+λVds)
For a current source connected MOSFET (with Gate at fixed voltage), if we apply ΔV at the drain terminal, the only change in current is due to ro of the transistor which is the λVds part.
But similarly, if we apply a change to both Gate and Drain which is the case in a Diode Connected Transistor, the change in the drain current is due to both the Vgs part (which gives the gm) as well as the Vds part (which gives the ro). Hence we get the (1/gm||ro)
.
In other words, gm is the transconductance from Gate to Drain. And if we are measuring Drain Resistance with a fixed Gate voltage, gm will not matter since the Gate Voltage does not change.
But in case of a Diode Connected MOSFET, the Gate voltage also changes which in turn causes a change in the drain current if gm*vgs
I hope I am making sense here...!