The ruling on Wednesday is a reversal of a lower court decision from earlier in the week.
The execution would be the first carried out by the US military after a court-martial conviction since 1961.
The decision from the 10th US Circuit Court of Appeals is likely to be appealed to the US Supreme Court.
Hasan, a former Army psychiatrist, used a laser-sighted handgun to kill 13 people in a medical facility at the sprawling Fort Hood base before he was shot by military police, ending his attack and leaving him paralysed from the chest down.
Hasan, born in the US to Palestinian parents, admitted at the outset of his military trial that he was the killer. The judge did not allow him to pursue his planned defence that the killings were justified because he was defending the Taliban in Afghanistan from the US military.
He was convicted of 13 counts of premeditated murder by a jury in a military court-martial in 2013.
Hasan, imprisoned at the Fort Leavenworth military base in Kansas, represented himself at his military trial, but is now being assisted by federal defenders and lawyers from the American Civil Liberties Union of Kansas.
President Donald Trump in October approved the execution of Hasan by a military firing squad at Fort Hood, calling him "a very bad and evil man".
US Defence Secretary Pete Hegseth later promised to livestream Hasan's death, which would have been a first. Trump cancelled Hegseth's livestream plans after widespread outcry.
US District Judge Anthony Mattivi on Monday said Hasan had shown a "significant possibility of success" in his claim against Trump and Hegseth and said he would be "irreparably harmed" without a chance to press the argument in court.
"The rule of law must be jealously guarded, and cases like this one test it most," the judge wrote.