The folks at Grammarphobia were asked this question and this was the opening excerpt from their response (click the link in the title for the full version):
When the word showed up in Middle English in the 14th century, “damn” was a verb meaning to condemn. It wasn’t until the 16th century that “damn” was used profanely.
English borrowed the term from Old French, but the ultimate source is the classical Latin damnāre or dampnāre, meaning to damage or condemn. (In fact, “condemn” ultimately comes from the same Latin source as “damn.”)
In Middle English, according to Oxford English Dictionary citations, “damn” had three related meanings: (1) to doom to eternal punishment; (2) to pronounce a sentence; (3) to denounce or deplore.
See also: The origins of the “black sheep”