That depends on what we mean by ‘courage. If by ‘courage’ or ‘bravery’, you’re trying to refer to a virtue, then they were not. If, by those words, you’re trying to refer to a willingness to face danger and overcome fear, then, sure, but in that case, courage isn’t praiseworthy.
Plato and Aristotle wrote about courage in, respectively, the Laches and the Nicomachean Ethics. Plato considers whether “courage is a sort of endurance of the soul”. Contending that there is such a thing as “foolish endurance”, but that courage is a virtue and virtuous behavior is never foolish, courage must be defined more narrowly than endurance; it has to be “wise endurance”. (He then contends that that’s not quite right, either.) Enduring danger and harm are only courageous when the danger or harm is one to be endured. If you jump off of a tall building, you’re in danger and liable to be harmed. That doesn’t make jumping off of buildings courageous. So, whether Confederate soldiers were courageous depends on whether the danger of dying in a war to preserve slavery was a danger worth facing.

Aristotle says that “Properly, he will be called brave who is fearless in face of a noble death”. But it’s possible for a person to be fearless at the wrong time: “Of those who go to excess he who exceeds in fearlessness has no name, but he would be a sort of madman or insensible person if he feared nothing, as they say the Celts do not; while the man who exceeds in confidence about what really is terrible is rash.” Some southerners of Celtic descent really have spent the last century and a half trying to live down to Aristotle’s stereotype about them — possibly a testament to the endurance of culture. But by Aristotle’s account, Confederate soldiers were courageous if dying in the defense of slavery is a noble death.

As David Blight explains in Race and Reunion, the story of sectional reconciliation after the Civil War is largely a story of concealment: southern white people, eager for regional autonomy, and northern white people, tired of the struggle and eager to get back to business, agreed to focus on how the men on each side had been willing to die for their respective causes, while ignoring what the causes were.
They would find national fraternity in shared courage, thus defining ‘courage’ as nothing more than a willingness to face danger. That’s one possible meaning for the word, but if that’s what courage is, then it isn’t praiseworthy.

Last weekend, while tabling in Georgetown, I had a discussion with a young man who contended that to die in battle has — I think that this is the word that he used — “holiness”, regardless of the cause for which one died. Who benefits from the idea that fighting for evil is just as good and virtuous as fighting for good? That sort of moral blur redounds to the benefit of evil.
“Rick and Morty”, season 3, episode 4, “Vindicators 3: Return of Worldender” has a snippet of dialogue that’s very much to the point.

Rick, mad scientist with very little regard for the consequences of his actions, is causing all kinds of havoc because he’s throwing a pathetic hissy-fit. Vaguely Captain America-like leader of the vaguely Avengers-like Vindicators, Vance, tries to explain to Rick’s hapless grandson Morty that he can be a hero: Vance: Everyone in the universe is a hero. All you have to do is know the difference between good and bad, and root for good.
Morty: Rick says "good" and "bad" are artificial constructs. Vance: Yeah, well, I get the feeling... [looks around at Rick’s destructiveness] he kind of needs that to be the case.

Anyone who needs good and evil to be equivalent is trying to put something over on you — like, say, systemic racism.