This article is from the Photographic Lenses FAQ, by David Jacobson with numerous contributions by others.
This is because the size of the image of an object depends on the distance the object is from the lens. This is not a defect in the lens---even pinhole cameras with no lens at all exhibit this perspective effect.
For image calculation purposes, think of the lens as being a pinhole one focal length in front of the film, and centered over the center of the film. (If the lens is not focussed at infinity, the distance from the film will be somewhat larger.) Then the image of an object point can be found by drawing a straight line from the object point through the pinhole and finding its intersection with the film. That line represents one light ray. (Diffraction and out-of-focus conditions have been ignored here, since they are irrelevant to this effect.)
If you do this, you'll find that the image of a nearby object will be larger than the image of the same object farther away, by the ratio of the distances. You'll also find that any straight line in object space, no matter at what angle or position, will be rendered as a straight line on the film. (Proof outline: a line, and a point not on the line define a plane. All rays from the object line will stay in the plane defined by the line and the pinhole, and the intersection of that plane with the film plane is a straight line.) But parallel lines in object space are not necessarily parallel on the film.