For starters, the second KKK wasn't a military organization, or a terrorist organization. It was a fraternal organization, like the Lions Club, the Rotary Club, or the Knights of Columbus, just a white, nativist, and Protestant organization. There were KKK marches, KKK businesses, and even KKK marketing programs. In classic American fashion, the rebirth of the Klan was taken out of the groundbreaking movie Birth of a Nation rather than any pre-existing Klan or even a neo-Confederate revival.
The Klan was a reactionary organization of sorts, in that they opposed not just blacks, but also Catholics and Jews-- a sort of Know-Nothing nativism married to largely performative demands for moral reform. Prohibition was good, divorce was bad, and the foreigners flooding the cities were listless and bad for America. That sort of thing-- the Klan was certainly a white, middle-class, respectable phenomenon.
It was wildly popular in both North and South, even though no major Protestant denomination would endorse the Klan. (This ended up culminating in the 1924 Democratic National Convention, where the pro-Klan and anti-Klan factions turned the DNC into a war zone, leaving the delegates unable to decide on a candidate for over 100 ballots. The infighting blew apart the party just in time to lose the 1924 election.) Anyway, that's how they came to be.
Their demise came about because of a combination of corruption and shamelessness. Corruption, because it became clear that many local Klan leaders were just in it for wealth and power; and shamelessness, because those leaders were often revealed as hacks and generally awful people. One critical event was when the head of the Indiana Klan, D.C. Stephenson, was convicted of raping, torturing and murdering Madge Oberholtzer, exactly the kind of white woman the Klan was supposed to be protecting. This, combined with massive opposition from new groups like the Anti-Defamation League, and the horror exhibited by mainstream protestants, led to catastrophic declines in the Klan's respectability.
They never recovered. In 1925, they had about 6m members; by 1930, their numbers had fallen to 30,000, and virtually had vanished as a political force.
Stuff to read: One Hundred Percent American, Pegram; The Clansman, Dixon; Last Call, Okrent
You'll have to clarify your question. Which KKK are you talking about?
Historically, there are actually four broad KKKs which have no organizational connection to one another. Chronologically, there's: