The idea of the 'confederate soldier ghost' was explicitly promoted to keep former slaves in line & this is the origin of the KKK's sheets, as described in Colin Dickey's Ghostland.
These guys got lucky in that ghost stories were a big part of an existing tradition of didacticism.
modernmythology.net/@enkiv2