A pinhole camera does have a large depth of field, but (due to diffraction) usually produces a less sharp image than a decent focused lens.
And with a moving subject, a lens obviously makes a sharper picture, since the pinhole requires such a long exposure.