what happened if the transistor is ON . vdd has a direct connection to ground as shown in equivalent switch diagram .it will short out the circuit. high current will flow.high current increase the temprature. if you are not lucky port pin might be burn out..
so u have to connet a resitor at drain called pull up resistor . it limits the current.it also provide correct logic levels when the transistor is on or off..
when the transistor is off it pulls up the drain terminal at high logic level thats what required…