Examples of the above senses:
(1) The singer issued an apology for his drunken behaviour.
(2) Adam Smith's The Wealth of Nations is an apology for free-market economics.
(3) It is not surprising that such an apology for a king was soon overthrown.

In senses 1 and 2, apology is a contranym: (2) is an argument that something is justified, whereas (1) is an admission that it is not. This can lead to ambiguity, e.g:

"The Pope's speech was an apology for the Inquisition."

It can also be used to mean a mixture of justification and regret, e.g:

"I would like to make an apology for my absence yesterday; I had urgent business elsewhere."

Slava wrote:I prefer using apologia for #2. While the above definition is correct, as you say it's misleading. I vote we delete it and go for apologia, which is a defensive noun, not an "I'm sorry" word.

Good idea. So we have apology and apologize on the "sorry" side, and apologia, apologist and apologetics on the "justification" side. However, the adjective apologetic can still have either meaning:

"He sent an apologetic letter to his publisher about the delay of his apologetic treatise on Christianity."