I don’t honestly know if this is a thing everywhere or if it’s just a Southern tradition. I suspect it’s universal. As a little boy visiting the cemetery, I can recall being admonished by my mother for walking on graves. “Step around them,” she told me. “It’s bad luck to step on somebody’s grave.” As an adult, I appreciate this delightful carryover from primitive times. Sure, good manners can account for some of it. You don’t step on somebody’s grave because it’s disrespectful. But beyond that, there are shadows of the dim past, when our ancestors feared that the dead could return to harm them if offended. This tradition isn’t even consigned to the past in some parts of the world, as the appeasement of the dead is still very much a thing. Think about the “Hungry Ghosts” of China, for example.
There’s also another, more practical reason for not walking on graves. It hearkens back to when coffins were made out of wood. Given time, the wood would decay. It was entirely possible that, if you stepped on a grave, the rotted wood might collapse and the unlucky person would plunge down into the grave. In the industrial world where coffins today are made out of metal and plastic this is less likely. Still, it’s poor manners.