The contents of the main page in a passport is dictated by standards set by the International Civil Aviation Organization (ICAO), specifically the Machine Readable Travel Documents standard (Doc 9303).
This document states that all passport photos should meet the following requirements:
1.1. The photograph should be less than six months old.
1.2. It should show a close up of the head and shoulders.
1.3. The photograph should be taken so that an imaginary horizontal line between the centres of the eyes is parallel to the top edge of the picture.
1.4. The face should be in sharp focus and clear with no blemishes such as ink marks, pen, pin, paper clip, staples, folds, dents, or creases.
1.5. The photograph should show the subject facing square on and looking directly at the camera with a neutral expression and the mouth closed.
1.6. The chin to crown (crown is the position of the top of the head if there were no hair) shall be 70 -80% of the vertical height of the picture.
1.7. The eyes must be open and there must be no hair obscuring them.
1.8. If the subject wears glasses, the photograph must show the eyes clearly with no lights reflected in the glasses. The glasses shall not have tinted lenses. Avoid heavy frames if possible and ensure that the frames do not cover any part of the eyes. Sunglasses cannot be worn or appear on the person’s head.
1.9. Coverings, hair, headdress, hats, scarfs, head bands, bandanas or facial ornamentation which obscure the face, are not permitted (except for religious or medical reasons. In all cases, the person’s full facial features from bottom of chin to top of forehead and both edges of the face must be clearly visible).
1.10. The photograph must have a plain light coloured background.
1.11. There must be no other people, chair back, or objects in the photograph.
Lighting, Exposure, and Colour Balance
2.1. The lighting must be uniform with no shadows or reflections on the face, eye-glasses or in the background.
2.2. The subject’s eyes must not show red eye.
2.3. The photograph must have appropriate brightness and contrast.
2.4. Where the picture is in colour, the lighting, and photographic process must be colour balanced to render skin tones faithfully.
Submission of Portrait to the Issuing Authority
Where the portrait is supplied to the Issuing Authority in the form of a print, the photograph, whether produced using conventional photographic or digital techniques, should be on good or photo-quality paper.
Compliance with International Standards
4.1. The photograph shall comply with the appropriate definitions set out in ISO/IEC 1974 – 5.
The last of the points above is probably the most important as far as "why" - ISO/IEC 19794 defines standards for Biometric data interchange formats, with part 5 specifically being Face image data. According to the ISO/IEC 19794 documents:
To enable many applications on variety of devices, including devices
that have the limited resources required for data storage, and to
improve face recognition accuracy, this part of ISO/IEC 19794
specifies not only a data format, but also scene constraints
(lighting, pose, expression, etc.), photographic properties
(positioning, camera focus, etc.), digital image attributes (image
resolution, image size, etc.).