In Photoshop Elements you can easily fix falling walls by using Image>Transform>Distort and then just drag the corners around until the walls are parallel with the edges of the photo.
Of coarse one can avoid falling walls all together by making sure the camera is level in the front-to-back plane. However, when the person took the photo to the above they were standing much lower than the home so they had to tilt the camera upward to get the home in the photo so it's not always so easy to keep the camera level. There are special tilt/shift lenses that would solve this problem with equipment but I find that it's so easy to "fix" photos after the fact that I don't worry about the issue while shooting. I just make sure all the walls are straight during editing.