Judge Gerald Bruce Lee said the more severe penalty was given as Abu Ali had not renounced al-Qaeda nor terrorist activities.
Abu Ali joined al-Qaeda while studying in Saudi Arabia and was trained by the group to carry out the assassination attempt and other terrorist acts, the court heard.
The judge said he had also considered the fact that the Bureau of Prisons has kept Abu Ali in solitary confinement at a prison in Florence, Colorado.
"There's no way to know what his mental state would be after 30 years of solitary confinement," Lee said.
'Forced confession'
In a statement to the judge, Abu Ali said that he had been tortured by authorities in Saudi Arabia into giving a confession.
"This was a case manufactured by the Saudi torture regime and expedited to the United States for trial," he said.
"I would like to remind you that you too will appear before the divine tribunal with me and everyone else.
"That day there will be no lawyers ... If you are comfortable with that, you can decree what you will."
Lee said that a lengthy hearing into the veracity of Abu Ali's confession had been held and that a jury and an appeals court had ruled that his confession was voluntary.
Joshua Dratel, Abu Ali's defence lawyer, said that he will appeal the sentence.