The outlaw motif in Westerns has its own development, but the great fountain of this whole stream is the myth of Jesse James.
Jesse James rode with Quantrill in the Civil War. Race is deeply involved with the outlaw myth, from the beginning to the modern incarnations like Firefly/Serenity.
The partial exceptions are there of course. But it is not an accident that the exceptions to the classic Western as revealed in hundreds of movies are no longer exceptional. The classic Western died, starting with integrations struggles in the Fifties. The TV Western died with television's usual lag behind the times.