Why do some 2 seat fighters have side by side seating, while others have the pilots inline with each other?
The tandem arrangement (one behind the other) is used on aircraft that have single seat variants. The F-15, F-16, and F/A-18 are all primarily single seat aircraft. It's much easier to stretch the nose out a bit to add a second position than to make it wider. This arrangement is also more aerodynamic, requiring less frontal area.

Fighter aircraft designed for a crew of two will often choose the tandem arrangement for aerodynamics. If both seats need forward visibility, there are compromises available. Some aircraft like the F-15E can be flown from both seats even though there is less visibility from the back. It's possible to have a bubble canopy in side-by-side configuration (this is particularly seen in aircraft kits), though it will create more drag than a tandem canopy.

Having the crew sit next to each other can be helpful for crew interaction and sharing instrumentation. The F-111 is one such special case:


  The USAF wanted a tandem-seat aircraft for low-level penetration ground-attack, while the Navy wanted a shorter, high altitude interceptor with side-by-side seating to allow the pilot and RIO to share the radar display.


This may have also been easier to design the escape capsule. Of course the Navy changed their mind and went with the F-14 instead for better maneuverability.