In 1955, they could build an engine of that size. They worked, they worked well. Being a military craft, they might get shot at, might have to fly in bad weather, might have to fly with some mechanical issue. With 8 engines, if one is broken or shot out, there’s still 7 more. Pairs is slightly cheaper than 8 individual mounting points.
This is a B-52. See how the person fits in there seated? It is about 4.5′ in diameter.

Then, 40 years later, engines got bigger. This next one is about 10′ in diameter. More than double the diameter, and thus about 4x the total size.

That’s an engine from a 777. It is about the same size as the body of a 727.
The fully fueled and maximum payload B-52H has a weight over 500,000 pounds (more than its maximum take-off weight). Back in 1961–63 when the B-52H were made, the 20,000 lb thrust class engines were well developed and nearly the largest.
Indeed the Boeing 707 had a maximum weight of 310,000 pounds in that era. Using a rough rule of thumb that maximum engine thrust is 25% of the max weight of the aircraft, four engines at that time could power a Boeing 707 or KC-135, but a 500,000 lb plus B-52H would need at least 125,000 lb in thrust. Eight engines gave them 140,000 lbs of maximum thrust and therefore tremendous capability.
By having the engines together, you only need four fuel line penetrations from the wing and you keep the engines clustered allowing room for under-wing weapons and external fuel tanks:

You notice the missiles mounted under the wing of the B-52H and the external fuel tanks mounted out towards the wing tips. The external fuel tanks were originally to be drop tanks, but due to some aero-elastic response of the B-52H wing, it was decided to make them permanent.
Therefore, you minimize attachments, minimize fuel penetrations, and maximize room to carry weapons and external pods under the wings.
To understand why in pairs, you should first ask, “why 8 engines”?
The initial concept was a straight wing turboprop

Which evolved into a swept wing turbojet

The B-52 was always a heavy strategic bomber design, based on a November 1945 proposed requirement.
For the next 3 years the design evolved amid conflicting desires within the by then US Air Force. The final XB-52 design was put together by a team from Boeing working over the weekend at their hotel.
One team member visited a local hobby shop for balsa wood in order to build a model to accompany the written proposal. The design drew heavily from the turbojet powered B-47, which also used twin-podded engines.

The problem for Boeing was the available engines, J-40 (initial design), J-47 (on the B-47) and newer J-57 were low on thrust but high on fuel consumption. Ultimately, all B-52 variants used improving versions of the P&W J-57 except the H model.
The XB-52 and YB-52 pre-production airplanes were equipped with experimental YJ-57 turbojets each capable of 8,700 lbf static thrust each. The last J-57 powered B-52G had 8 engines each rated at 13,750 lbf static thrust with water injection.
All of that leads to this: The early turbojets were lacking in thrust. A fully loaded B-52 needs 8 engines to be able to accelerate, lose an engine, and safely continue the takeoff, liftoff and climb.
The eight engines of the B-52 are paired in pods and suspended by four pylons beneath and forward of the wings’ leading and the arrangement of the pylons also allowed them to work as wing fences, common on swept wing airplanes, and delay the onset of aerodynamic stall.
By using paired pods, the design teams was able to:
- Use only one pylon per 2 engines reducing weight and drag
- Reduce infrastructure (wiring, piping, ducting) to the 8 engines reducing weight
- Provide lower wing surface for external weapons pylons, fuel tanks, etc.
The B-52H ditched the turbojets and instead was powered by the TF-33/JT-3D low bypass turbofan each producing 17,500 lbf static thrust.

The aging TF-33 engines are being replaced with the Rolls-Royce F130 turbofan. Unlike the previous re-engine proposal which also involved reducing the number of engines from eight to four, the F130 re-engine program maintains eight engines on the B-52.
Although four–engine operation would be more efficient, retrofitting the airframe to operate with only four engines would involve additional changes to the aircraft’s systems and control surfaces (particularly the rudder), thereby increasing the time, cost and complexity of the project.