Answer: Because the water is more dense.
Explanation: Any object that is less dense than water will float. Since the pumpkin is less dense than water, the water is able to push the pumpkin up, so that it floats. On the other hand, objects denser than water will sink. Pumpkins aren't very dense even though they're large, it's mainly hollow inside causes the pumpkin weigh less.