The ozone molecule, which consists of three atoms of oxygen, has a number of properties. If you breath in ozone it is a poison, so too much ozone near the earth’s surface is a problem. Ground level ozone is mainly a result of pollution from motor vehicles.
Ozone also absorbs ultraviolet (UV) radiation from the sun. Too much exposure to UV radiation causes skin cancer and damages plants. Ozone naturally concentrates in the stratosphere, 10-15 miles above the earth’s surface, well away from the surface.
The US Environmental Protection Agency has a brochure “Ozone: Good Up High, Bad Nearby” that explains this apparent contradiction in more detail at http://www.epa.gov/oar/oaqps/gooduphigh/.