Why should we set input source equal zero for calculating output resistance of common source amplifier?
The reason is that when you try to get a Thevenin equivalent circuit, using the 'test source' method, you set all the independent voltage and current sources to zero. However, you keep the dependent sources intact.

\$V_t\$ is your test source and to find the equivalent resistance looking into that terminal you need to find \$I_t\$. Then \$R_{equiv}=\frac{V_t}{I_t}\$.