Mouthpieces serve at least two purposes. The first is to prevent cross-contamination among patients using PFT equipment. The ATS Statement on General Considerations for Lung Function Testing, (Eur Resp J, 2005; 26: 153-161) discusses this and it is clear that mouthpieces should be used whenever and wherever pulmonary function tests are performed.
The second purpose however, is to prevent patients from leaking air during testing. Leaks are a chronic problem for all pulmonary function tests.