I'm surprised at the lack of parallelism of vertical elements. I was pointing up at a diagonal to avoid a fence; is that all there is to it?
The source of the distortion is the camera’s viewpoint. A combination of subject distance and the angle-of-view, delivered by the chosen focal length of the lens, produced the distortion. Your location was such that you were required to angle the camera upward to include all of the structure. This upward aim is the main culprit. Had you stepped back or used a lens with a wider angle-of-view, it might have been possible to hold the camera level; this action would have minimized the distortion.
In architectural photography we use specialized cameras that allow the image plane to remain parallel to the structure. The lens mount is gimbaled to allow the lens to swing upward independent of the image sensor (or film). This maintains the parallelism.
Consider a tall building being imaged. You are at street level, the distance from the camera to the top of the building is greater than to the base of the building. Things close to the camera reproduce large, while things further from the camera reproduce small. Thus the top of the building images as a narrower structure than the base of the building.
If you shoot this image from a viewpoint at the middle of an adjacent high-rise, both the top and the bottom of the building would image narrower that the center.
There are tricks that an architectural photographer can employ. Key is a camera with swings and tilts that allow the image plane and the lens plane to move in relationship to each other. Clever placement mitigates, to a great extent, this distortion. During the printing of the image, additional corrections can be applied. This includes the use of editing software to alter the perspective of the image
Normal perspective still includes... perspective. If you point your camera upwards to focus on a really tall chimney you would find a vanishing point.
If your camera is parallel to the chimney you get parallel lines, because your camera is really parallel (green rectangle).
When you tilt your camera up (A) you start to see that perspective.
To achive parallel lines you need a shift lens, so the lens is kept parallel and you move your sensor to capture the far part of the chimney (B).