B-52 was meant to do so for the requirements of 1952 when:B-52 always was meant to strike the most defended airspace on Earth - and even if it long lost its capability to penetrate these defenses personally, it is still meant to.
Even if it has lost its ability to do pre-strike/post-strike survey due to the need to use stand-off munitions - it is still more capable of engaging defended airspace than the B-2. Even now, a decade after losing its ACM loads.
(2)
B-52 was arguably the core of late-cw USAF anti-shipping capability, in a manner not dissimilar to Soviet maritime missile regiments themselves; B-52 is fully capable of low-altitude flight, thus it could(and to a degree - can) get to strike distance.
While harpoon was light - B-52s could carry loads of them. And now they're getting LRASMs - far more destructive(twice warhead weight) yet even more numerous - full cruiser salvo worth of them per ship, in fact - and will bring more within a few hours if necessary.
(3)not too far of a future brings in hypersonics, too.
BUFF shall never be underestimated.
1. look down radar didn't exist (first one ever: AN/ASG-18, 1960)
2. real SAMs didn't exist (first Russian one: SA-1, 1955)
3. air to air missiles didn't exist (first US one: 1956 AIM-4, first Russian one: 1957 K-5)
as you can see that is a totally incomparable threat environment. before even 5 years passed, it was obsolete in attacking defended targets.
late Cold War B-52s were utterly unsurvivable in the antiship role as Harpoons had only 200 km range vs. Kh-22s with 600 km range.