Couple of other reasons:
It's paid for. Sure, the Buff's engines are not that efficient, even after being re-engined with turbofans, but the cost of the extra fuel isn't anywhere near the $100-150 million it would cost to replace the B52 with a Bone, or the half billion that a B2 costs. You can buy a lot of JP4 for that sort of money.
We bought a whole bunch of them. Final production was 742, which is a lot of heavy bombers. Why scrap them and blow money on a replacement, when they still work? The 50 or so B52's still in service have a huge inventory of spare parts to draw from.
The conflicts the Buff is used in now tend to be lower intensity, with lower threat to the aircraft. Why use a half billion dollar B2 and risk loss from operational problems, if the opponent doesn't have radar to detect the incoming bomber, or SAM's to do something about it even if they do detect it coming in?
The maintenance procedures were worked out decades ago, so no surprises there. Yes, it has a bleed air system known to be a nightmare, but service is well documented, and fairly inexpensive. The B1 has a swing wing, which can be rather pricey to maintain.
It is very tough. It's predecessor, the B47, was quickly retired when low altitude flying caused cracks in the wing spars. The Buff can fly at low altitudes without suffering that problem. Low altitude characteristics became critical when Soviet SAM's made high altitude bombing a very dangerous occupation. With a very strong airframe, B52's can take a lot of hours of flight without serious decay. There is a well documented video of a B52 minus most of its horizontal stabilizer, that sheared off in flight due to excessive side loads. It was landed without further damage.
For many years, NASA operated a pair of early B52's, tail numbers 002 and 008, with the original and very inefficient turbojet engines. Reason? Those engines perform better at very high altitudes than turbofans, and the NASA B52's were used for research and launching test aircraft at very high altitudes. The last one, 008 was finally retired without many hours on the airframe, still sporting a cutout section on it's starboard wing flap, put there to accommodate the X-15's tail when it was being hauled aloft for launching.
Due to that cutout section, 008 was always landed without flaps. (would have produced asymmetric lift) That must have been fun...