I suggest looking at /u/x--banks--x comment on this topic a few years ago: https://www.reddit.com/r/AskHistorians/comments/2088gl/comment/cg10gyp
For the words of Robert Caro, arguably the foremost Johnson biographer:
LCM: The nation will be marking the 150th Anniversary of the Civil War. Like Lincoln, Johnson’s true motives on promoting racial equality have been questioned. Have you come to any conclusions about that?
Caro: The reason it’s questioned is that for no less than 20 years in Congress, from 1937 to 1957, Johnson’s record was on the side of the South. He not only voted with the South on civil rights, but he was a southern strategist, but in 1957, he changes and pushes through the first civil rights bill since Reconstruction. He always had this true, deep compassion to help poor people and particularly poor people of color, but even stronger than the compassion was his ambition. But when the two aligned, when compassion and ambition finally are pointing in the same direction, then Lyndon Johnson becomes a force for racial justice, unequalled certainly since Lincoln.
https://blogs.loc.gov/loc/2013/02/last-word-author-robert-caro-on-lbj/
Like most people, Johnson was a complicated guy. Racism is tough subject because we all see patterns and extrapolate from them and it just depends on whether we want to see the positive in identifiable groups or the negative. For Johnson, in order to get things done, he played both sides (Dixiecrats v Liberals) for his advantage. And while he was insulting, he was also a pragmatist that got things done. Here is a good summary of the Robert Caro analysis: https://professornerdster.com/key-takeways-from-the-years-of-lyndon-johnson-by-robert-caro/#Tactic_8211_Working_Himself_Out_of_His_Bad_Side_the_compassionate_versus_the_hurtful_Johnson