That's exactly what I was thinking.
To me, the diference between the two photos that the OP posted is not so much the result of the lens. . Rather, it is the result in the change in perspective that he got by stepping back. . Stepping back completely changed the ratio between the camera-to-subject distance and the subject-to-background distance.
The OP also took the two photos from two different angles. . Not only did he step back, but ha also stepped to his right. . That is why the background is different.
And then we have the drastically different use of lighting between the two photos, which accounts for most of the difference. . When you change the amount of light on the subject relative to the amount of light on the background, that is going to make a vast difference in what the photos look like. . And it has nothing to do with the lens that was used.
I'd just hate for noobies to read this thread and think that the lens is what made the difference. . The 17-40mm could have produced an image very similar to the one that the 70-200mm produced, if it had been used differently. . The 2.8 aperture wouldn't have been necessary to get a photo that is pretty similar to image #2 - f4 would've been able to produce a fairly similar result, so long as the afore-mentioned distance ratio had been maintained.
I think that the difference between the two photos is attributable to good photography - a photographer who knows what to do to create a pleasing image in a given situation. . The OP's skill and experience is what led to the change in perspective and the change in lighting. The lens just allowed him to more readily facilitate those changes, as the 17-40 would have resulted in different framing if used from the further-back camera-to-subject distance.
Couldn’t of said it better myself