Because the water molecule is stable. It requires a lot of energy to split the hydrogen and oxygen. Also, combustion of anything with hydrogen in it always creates water vapor along with other products. This indicates the stability and inertness of water.
Oxygen by itself makes substances burn, and hydrogen by itself burns with great heat. But in water each is fully combined with the other, and cannot combine quickly with anything else.
When flung on a flame, water has the triple effect of smothering the flame by turning into steam and preventing air getting at it, of making things which it wets less ready to take fire, and of cooling down things which have become dangerously hot.