A moral victory occurs when a person, team, army or other group loses a confrontation, and yet achieves some other moral gain. This gain might be unrelated to the confrontation in question, and the gain is often considerably less than what would have been accomplished if an actual victory had been achieved.
For example, a sports team that is a heavy underdog and loses narrowly to a superior opponent might claim a moral victory, acquitting themselves well even in defeat. A team that plays fairly and loses to a cheating team might also claim a moral victory in spite of the loss.
Another moral victory can be seen in Arthur Miller's play The Crucible, where the character Giles Corey was pressed to death by large stones because he remained silent, neither denying nor confirming the accusations of witchcraft. Because "witches" had all their land and property taken from them, his silence allowed his children to inherit his land when they could not have otherwise.
Others may include scenarios in which a force loses a struggle, but inflicts great losses upon their opponents (the opposite of a Pyrrhic victory. Examples include The Alamo and the Battle of Thermopylae).