LBJ knew what the cost were, so I would say moral imperative.
http://www.archives.gov/publications/prologue/2004/summer/civil-rights-act-2.html
Bill Moyers, a former aide to LBJ, recalled, in a statement during a 1990 symposium at the Johnson Library: The night that the Civil Rights Act of 1964 was passed, I found him in the bedroom, exceedingly depressed. The headline of the bulldog edition of the Washington Post said, "Johnson Signs Civil Rights Act." The airwaves were full of discussions about how unprecedented this was and historic, and yet he was depressed. I asked him why.
He said, "I think we've just delivered the South to the Republican Party for the rest of my life, and yours."