Oxygen in beer is undesirable except at one point (and only one point) in the brewing process. That lone point is when the post-boil wort has been chilled down to fermentation temperature, but before the yeast has been pitched into it.
Oxygen dissolves into wort as a function of temperature and specific gravity. As such, the colder and less concentrated the wort, the more oxygen will be able to enter into solution. All the bubbling and splashing that occurs during the boil drives most of the oxygen out of solution because the wort is too hot while boiling. Therefore, oxygen must be replenished after the wort is cool and able to retain the oxygen in solution again.
Oxygen is essential for yeast growth and reproduction. Yeast must grow and reproduce first, before actually fermenting the wort to make beer. Yeast needs oxygen to synthesize the material for expanding cell walls; namely sterols and fatty acids. Overlooking proper wort aeration can lead to problems such as long lag times before the start of fermentation, stuck or incomplete fermentation, or excessive ester (fruit flavor) production, any of which would produce less than desired results.