Good question, and you're not alone in noticing. There are a few practical reasons this happens, and they mostly come down to rack design and bike weight.
Most city bike racks are the standard inverted-U or wave style. They’re fine for a 20–25 lb road bike, but a delivery e-bike with a battery and cargo box can easily weigh 60–80 pounds. Lifting that weight up and over a high bar, multiple times a day, is exhausting and can damage the bike or the rack. The tree pit fence or a street sign is usually at waist height, so the rider can just lean the bike against it and lock through the frame and rear wheel without lifting.
There’s also a security element. Some older racks are poorly anchored or have loose bolts; a thief can sometimes lift the whole bike off. A fence rail, especially a newer tree guard, is often more solidly bolted to the concrete, so it feels more secure.
To answer DykerNewbie: locking to a tree pit fence or street furniture is technically against DOT rules, but enforcement is almost nonexistent. It can become a real problem if it blocks the tree bed gate or makes the sidewalk impassable for wheelchairs or strollers.
In my neighborhood, I’ve watched riders pass three empty racks to lock to a basement grate because the grate is lower. The city has started installing some low-clearance racks in certain corridors, and that has helped a bit. But until they’re everywhere, fence rails are going to keep winning.
One caveat: even with better racks, some riders will always pick the closest object for a 60-second stop. That’s just delivery culture. But the weight issue is real.