The main reason for having tandem seating in fighter aircrafts is that it offers better performance compared to the side by side version. This is why most of the high performance fighters have tandem seating arrangement.
"Sukhoi Su-30LL demonstrator flying along the runway at Zhangjiajie Hehua Airport less than 1 metre off the ground"
by Xu Zheng - http://www.airliners.net/photo/Russia---Air/Sukhoi-Su-30LL/1025605/L/. Licensed under CC BY-SA 4.0 via Commons.
Another advantage in tandem seating arrangement is that conversion from single to double seat (and vice-versa) variant is relatively easy and requires minimal design change compared to the side by side configuration.
"Su-27 05" by Unknown - DefenseImagery.mil ID DD-ST-88-09314. Licensed under Public Domain via Commons.
The main advantage of the side-by-side seating arrangement is that it allows for better work sharing between the crew and reduces the need for duplication of flight instruments. The crew comfort is also (comparatively) better for long range flights, reducing fatigue.
"Sukhoi Su-34 at the MAKS-2013 (03)" by Doomych - Own work. Licensed under Public Domain via Commons.
Also, the customers (Air Force/Navy) may also decide which arrangement to use. For example, the initial postwar British trainers used side by side seating as RAF preferred this arrangement.
In case of B-52, the prototypes (and even the initial production aircraft) had a tandem seating arrangement.
"YB-52sideview" by Original uploader was Sf46 at en.wikipediaLater version(s) were uploaded by Nobunaga24 at en.wikipedia.(Original text: U.S. Air Force) - Transferred from en.wikipedia; Transfer was stated to be made by User:Nobunaga24.(Original text: USAF Museum Website). Licensed under Public Domain via Commons.
However, Gen. LeMay decided that a aside by side arrangement utilizes the copilot better and improved instrumentation and the arrangement was changed from tandem to side by side.
"Boeing B-52D-40-BW (SN 56-0695) and GAM-72 Quail decoy missile and trailer 061127-F-1234S-010" by US Goverment. Licensed under Public Domain via Commons.