Okay going to be a buzz kill here. The B52 of now is not the B52 of the past. It was designed as carpet bomber. However in the world of precision munitions, carpet bombing is just not needed. But no matter what decade you are in, war still requires a shit ton of munitions and some way of hauling them. The B52 is that munitions hauler. The reason why no replacement, is simple, good luck trying to convince the Pentagon to spend a shit ton of money to design, engineer, and build what is essential a giant glorified truck. As weird as it may seem, it makes economically sense to keep the old girl working.
If you are the one claiming it's the perfect cargo plane, even better than cargo planes, it's on you to prove it. What even is this conversation, it started you thinking cargo airplanes were civilian and then you just duck and weave on everything in the weirdest way.
I think the missing piece here is that B-52 isn't just a pretty good cargo hauler, it's a pretty good cargo hauler that we don't need to buy a whole new airframe to get. Think of it less as "we're commissioning these B-52s" and more as "hey look we found a way to use all these B-52s we already had" only this just keeps working forever.
The b-52 is a US long range strategic heavy bomber. It's been in service for a very long time, and the reference seems to be that we'll just keep updating it until it's eventually also "new" and refreshed when the enterprise is being decommissioned.
It can definitely haul cargo, and we have much less use for the type of bombing that it does in modern times. It was still built as a strategic bomber.