It’s less about his doing it on his own time than the place he chose to do it. If this guy had kept his racist BS with his family and friends and in comment sections it wouldn’t have cost him his job.
Instead he decided to take his trolling out amongst his opponents and forgot that saying “n*gger” in public (especially with cameras present, as they always are) is different than posting it in a chat room or bloviating at his regular bar. No company wants to be associated with a racist viral sensation.
The only thing that might have saved his job was union membership, but I’d be willing to wager he’s likely the sort of blue collar shmoe who votes GOP and who think unions are evil.