In the late 1950's Senate Majority Leader Lyndon Baines Johnson was forming his first presidential campaign. He was advised his largest liabilities for national office was his vocal and consistent leadership in defense of segregation. This all but made him unelectable in the North and the West. In 1957 Johnson could not afford to alienate any of these regions. Johnson would try to finesse this liability. LBJ would outwardly support the 1957 civil rights bill, meanwhile he used his power as Senate Majority Leader to divert the bill into a committee controlled by a powerful southern committee Chairman. In the committee the 1957 bill would be neutered.
Johnson sent the (1957 civil rights) bill to the judiciary committee, led by Senator James Eastland of Mississippi, who proceeded to drastically alter the bill.
In 1957, Johnson hoped that he would both be given credit for passing the bill by the bills northern supporters, and would be given credit for weakening the bill from southerners opposed to the legislature. Legislatively Johnson was successful, politically it was a failure. The weakened bill passed. However, Johnson lost the Democratic nomination for the Presidency in 1960 to the junior Senator from Massachusetts, John F. Kennedy who had a much bolder agenda on civil rights.
As @congusbongus stated above in his answer...Lyndon Johnson was first an ambitious politician who long craved to become President. As a Freshman congressman in the 1930's he told his staffers to refer to him as LBJ because it sounded like FDR. "FDR-LBJ, LBJ-FDR "get it?". Johnson had arrived in Washington planning on becoming president. (From Master of the Senate, page 100)
In preparation for the 1964 election Johnson would prove to be one of the boldest and most effective desegregationists when it was politically in his interest to be so. On November 22, 1963, President Kennedy was shot and killed in Dallas Texas; leaving LBJ President. LBJ inherited a powerful political machine and an American public who mistrusted him due to his well known and lengthy resume as leader in the Senate. Johnson took immediate steps to close the daylight between himself and the fallen president.
The fallen President who had tried and failed to pass what would become the 1964 civil rights bill. Now with the entire nation mourning, it was in Johnson't political interest to do what many thought was impossible. Pass this landmark legislation and broaden his own political base by showing he was a man of vision capable of leading the agenda which Kennedy had presented and sold to the nation. Johnson would resurrect and pass the most comprehensive civil rights bill in the nations history.
**Robert Caro Pulitzer Prize-winning biographer and historian on Lyndon Baines Johnson **
from Dian Rehm show
CARO You know, Johnson was a very complicated man. He was filled with ambition and he was filled with compassion, but the truth is, whenever the two of them collided, whenever he had to be one the Southern side, ambition was what won. But I wrote "when ambition and compassion were both pointing in the same direction, he was a force that was unlike anything else in American history."
All right. But then, what do we know about why he decided to move so quickly once he became president, ( and target the 1964 civil rights bill)?
Well, I'll tell you what he said to someone who doubted he was sincere. A speech writer of President Kennedy's before him, named Richard Goodwin, quite a brilliant man, Goodwin sort of asked the same question you did. And Johnson said, you know -- why are you making this a priority? And Johnson said, you know, when I was teaching those kids, I swore that if I ever had the opportunity to help them, I would.
President Johnson in 1963 still had never won a national election. He had never even competed in a national election as head of the ticket. Now he was President, Leader of the political machine which Kennedy had built; only the Kennedy's hated him. So five days after President Kennedy was shot; on Nov 27, 1963; as the entire country mourned, on national TV, in his first address to a joint session of congress; President Johnson ties the legacy of the dead president and the 1964 civil rights bill to his own campaign for President.
Johnson told the legislators, "No memorial oration or eulogy could more eloquently honor President Kennedy's memory than the earliest possible passage of the civil rights bill for which he fought so long.... Then he told his fellow southerners, "We have talked long enough in this country about equal rights. We have talked for one hundred years or more. It is time now to write the next chapter, and to write it in the books of law."
Johnson then goes on to champion that 1964 civil rights bill and in July of 1964 as President he signed the landmark legislation. Tying himself and his election to the fallen president and securing one of the largest landslide victories in the nations history. With Barry Goldwater only winning 6 states. His home state of Arizona; and the 5 deep south states of Louisiana, Alabama, Mississippi, Georgia, and South Carolina.
Johnson went on after the 1964 Civil Rights Act, to pass the 1965 Voter's Rights Act. Together these two landmark Acts ushered in dramatic changes the country.