The Leaning Towers Illusion was first published the journal Perception in 2007. The illusion also won the Best Illusion of the Year contest in 2007.
The illusion occurs because of the nature of perspective. Two tall structures that are actually parallel, like two towers, will actually converge on the two-dimensional surface of the photo when photgraphed from below. One can see this in the photo below of the Petronas Towers. Kingdom et al. (2007a) claim that our brain corrects for this distortion and represent the towers as parallel.
Thus, if two towers do not converge on the surface of a photo or image, as they do not in the Leaning Tower Illusion, our brain interprets the towers as diverging in real life. The mechanism that usually works so well when interpreting the world breaks down when interpreting two photos side by side. One can also see this in the two identical photos of the left-hand Petronas tower side by side below.
Kingdom et a.l (2007a) suggest that our brains go wrong because they treat the two images as if they were part of a single scene, when they are not. The fact that we cannot overcome this suggests that there is some degree of cognitive impenetrability in our vision. In other words, our belief (indeed knowledge) that the two towers are identical does not affect our visual experience of them such that we come to experience them as identical. We continue to experience one as more leaning than the other. For an examination of the general issue of cognitive penetration, see Macpherson (2012).
Kingdom et al. (2007a) also point out that this effect is not limited to photos of tall things photographed from below. One gets the same effect from many photographs that involve parallel lines. One can see this illustrated by the pairs of photographs below.
Finally, Kingdom et al. (2007b) produced a figure that shows that the leaning tower effect does not accumulate. This means that if many leaning towers are next to each other, while each subsequent figure to the right seems more leaning than the one to its left, the effect does not add up so that a figure more than one to the right of another does not look more leaning than the one to its immediate right. That this does not happen can be seen in the image below. Although each tower looks to be more leaning than the one to its left, the rightmost tower looks no more leaning than the second left tower does when contrasted with the leftmost tower.
This means that the series appears somewhat paradoxical. There could not be a series of six towers where the one to the right was always more leaning that the one to its left, and yet the rightmost tower was not more leaning than any of the other towers. This image then is a form of impossible figure. There are many such figures in the Illusions index that you can search for and read about in more detail.