Forget racism, forget losing the war. The flag that people love to hate is a symbol of rebellion against what was perceived to be unfair laws, and business practices. The South was, yes, on the surface pro-slavery, but the north did NOTHING to solve the thorny issue. The northern cotton manufacturers, in fact, loved the status quo because they got the profits from refining the cotton and for shipping it overseas. The South was ass out with no saltwater ports.
So down in the south this symbol that everybody hates is a symbol of not being bullied anymore. Do you honestly think the south thought they had a chance against the federal government? They knew the odds, but chose to fight anyway.