When we look at a building we are almost always stood on the ground. Looking up, the top of the building is further away than the bottom, making the top appear smaller.
The best viewpoint is to be on align with the middle of the building. Making sure the camera is perfectly horizontal. From this ideal position the distance to the top of the building is the same as the distance to the bottom. Making the vertical parts of the building parallel and perfectly vertical.
There is another way to avoid the unwanted perspective, that is to get as far away from the building as possible. But in most cases not very practical.