As discussed in An Anarchist FAQ's appendix on Symbols of Anarchy, anarchists at first used the Red Flag as their symbol of choice, with the Black Flag slowly replacing it over a period of many decades. Both flags, however, had their roots in working class struggle and protest, both were anti-capitalist symbols raised by working class people in revolt against exploitation and oppression.
Given that the Black Flag became the preferred anarchist symbol in the 20th century, it comes as no surprise to see that both Proudhon and Bakunin praised the use of the red flag. Bakunin, for example, wrote of "the flag of theoretical materialism, the red flag of economic equality and social justice, is raised by the practical idealism of the oppressed and famishing masses, tending to realise the greatest liberty and the human right of each in the fraternity of all men on the earth." [God and the State, p. 47] Proudhon a few weeks after building barricades in Paris, as historian Jack Hayward notes, "predicted in March 1848 the internationalism of the Red Flag" when he wrote: "Keep if you wish the tricolore, symbol of our nationality. But remember that the red flag represents the final revolution . . . The red flag is the federal standard of humanity!" [quoted by Hayward, After the French Revolution, p. 246]
Originally, as Hayward reports, the Red Flag was flown from the Paris town hall to signal the proclamation of martial law to deal with food riots in 1789 and in July 1791 it was used at the massacre of anti-royalist demonstrators. In 1792, the republican revolutionaries turned it into a symbol of defiance by inscribing on red flags: 'Martial law of the sovereign people against the rebellion of the executive power'" [Op. Cit., p. 245] After that, use of the Red Flag declined:
"the Red Flag went into eclipse. The tricolore carried all before it for the rest of the Revolution and under Napoleon, being readopted at the 1830 Revolution as the emblem of the July Monarchy. The Left sought an alternative and at first it was the Black Flag symbolising a fight to the death that appeared in the 1831 Lyons riots, with its slogan: 'Work or Death.'" [Op. Cit., p. 245]
So the Black Flag was a recognised symbol of the Left, so it was unsurprising that when the Red Flag became too associated with Marxist social democracy in France, the likes of Louise Michel urged anarchists to raise the Black Flag.
Why did the Red Flag become the symbol of choice for the socialist movement, Proudhon and Bakunin included? For this, we need to look at the 1848 Revolution in France and, in particular, the activities of that perennial state-communist revolutionary, Louis Auguste Blanqui. It was in February 1848 that the Red Flag "appeared during the insurrection for the first time as a workers' banner on a large scale, alongside the tricolore. It symbolised their wish for break with the Orleanist past." Blanqui's first symbolic act of that revolt was to issue a manifesto "deploring the decision to retain the tricolore as the national flag instead of replacing it with the Red Flag." The 25th of February saw a demonstration of armed citizens carrying red flags. [Hayward, Op. Cit., p. 245]
As with the use of the Black Flag by anarchists, the use of the Red Flag by socialists of all tendencies spread from France. In Britain, the Red Flag was adopted as a Chartist symbol on 31st of December, 1849. On 10th November 1850 European Socialists in exile in London adopted it in place of their national flags, "a prelude to it becoming the emblem of the First International in 1866." [Op. Cit., p. 246] Its adoption by the International Workers Association should come as no surprise given the key role the French followers of Proudhon played in setting it up. [George Woodcock, Anarchism, pp. 198-9]
It comes, therefore, as no surprise that the newspapers of the time denounced "the Red Flag of anarchy", given that anarchists (like others in the revolutionary workers movement) raised it in their struggles and revolts. Both Proudhon and Bakunin associated themselves with that symbol, just as they both proclaimed themselves socialists. However, after their deaths state socialism came to dominate most labour movements in the world and the Red Flag became associated with Marxian social democracy and anarchists sought other symbols. With Communard and indefatigable revolutionary Louise Michel taking the initiative, that other flag of French working class revolt, the Black Flag, was taken up as a replacement. Use of the Black Flag continues to this day...