I don't know what it could have meant in that context.
"Damn!" is short for "damnation," which means "condemned to hell." In middle-ages Christian theology, after death souls are judged and are either sent to Heaven where they live with God in eternal happiness, or they are sent to Hell where they live with Satan and are tortured forever in burning brimstone (sulfur). "Damn!" or "Go to hell!" is the kind of bad language called "profanity," religious bad language.
When said to a person it is impolite, disrespectful, angry, and hostile. But it isn't sexual or racist.
In the U.S. it's not considered very bad language any more. The 1939 movie "Gone With The Wind" was a turning point. It was shocking at the time when Clark Gable said "Frankly, my dear, I don't give a damn."