Why does the hot water tank need to be drained of water in order to replace the gas valve?
The valve should have a part that inserts into the tank to measure temperature in the tank and decide when to turn on and off. When you remove that part, the water will drain out anyway. Better to control the drain especially if the water is hot.