Water contains oxygen. The Miller-Urey experiment used some water and was energy activated using some electrical discharge intended to simulate lightning conditions, believed to induce reactions in the inanimate matter used to produce chemical reactions that created compounds believed to be consistent with what were needed to form a complete initial organism.
The electrical discharge, if intense enough, is sufficient to induce electrolysis, which separates water into H and O, but the amount of O produced was not large enough to fundamentally negatively affect the experiment. Nevertheless, the experiment used the wrong basic inanimate matter, principally the atmosphere, and did not produce the essential compounds to show viability in creating the conditions for the origin of life.