It’s unclear if the law decrees it always will.
The Unforgivable Curses have had the strictest penalties imposed on their use by the British Ministry of Magic since 1717, but it’s never said at any point if there are any circumstances that justify their use under the usual British wizarding law.
“19 The Cruciatus, Imperius, and Avada Kedavra curses were first classified as Unforgivable in 1717, with the strictest penalties attached to their use.”
- The Tales of Beedle the Bard
The use of an Unforgivable Curse is enough to earn a life sentence in Azkaban, but it is not said if it always earns a life sentence in Azkaban regardless of the circumstances.
“Now … those three curses – Avada Kedavra, Imperius and Cruciatus – are known as the Unforgivable Curses. The use of any one of them on a fellow human being is enough to earn a life sentence in Azkaban.”
- Harry Potter and the Goblet of Fire, Chapter 14 (The Unforgivable Curses)
It seems likely enough to there may be circumstances in which the use of an Unforgivable Curse doesn’t earn a life sentence even by Ministry law. At one point they legalized their use on suspects, and although that law was repealed, its existence shows that the Ministry may be willing to make exceptions in certain circumstances.
“Crouch’s principles might’ve been good in the beginning – I wouldn’t know. He rose quickly through the Ministry, and he started ordering very harsh measures against Voldemort’s supporters. The Aurors were given new powers – powers to kill rather than capture, for instance. And I wasn’t the only one who was handed straight to the Dementors without trial. Crouch fought violence with violence, and authorised the use of the Unforgivable Curses against suspects.”
- Harry Potter and the Goblet of Fire, Chapter 27 (Padfoot Returns)
However, an equally viable possibility is that it was simply a case of Barty Crouch Sr. making a judgment in his position of power that the Ministry never would make under another’s leadership, and inapplicable to Ministry law in general.
However, in practice, that isn’t the case.
Though it may be the Ministry’s intention to give anyone who uses an Unforgivable Curse a life sentence in Azkaban, that is not what actually happens. Harry used it in the Ministry headquarters itself while still underage and carrying the Trace but received no punishment for it whatsoever.
“Hatred rose in Harry such as he had never known before; he flung himself out from behind the fountain and bellowed, ‘Crucio!’
Bellatrix screamed: the spell had knocked her off her feet, but she did not writhe and shriek with pain as Neville had – she was already back on her feet, breathless, no longer laughing.”
- Harry Potter and the Order of the Phoenix, Chapter 36 (The Only One He Ever Feared)
Harry uses the Cruciatus Curse a second time, at Hogwarts on Amycus Carrow, and is also not punished for it. Though the Dark Lord was in power at the time and his followers were allowed to use Unforgivable Curses, it is not clear if the general public was also allowed their use at the time, and even after his downfall Harry is never given punishment.
“Harry pulled the Cloak off himself, raised his wand and said, ‘You shouldn’t have done that.’
As Amycus spun round, Harry shouted, ‘Crucio!’
The Death Eater was lifted off his feet. He writhed through the air like a drowning man, thrashing and howling in pain, and then, with a crunch and a shattering of glass, he smashed into the front of a bookcase and crumpled, insensible, to the floor.”
- Harry Potter and the Deathly Hallows, Chapter 30 (The Sacking of Severus Snape)
Therefore, even if the intention of the law is to always have any use of the Cruciatus Curse result in a life sentence in Azkaban, this is not truly the case.