The tech giant, which had been favoured to win the cloud computing deal, sued past year after the US Defense Department gave the opportunity to arch-rival Microsoft instead.
Amazon has accused officials of bowing to pressure from Donald Trump. Amazon believes that President Trump shows bias against the company because the Washington Post, a paper owned by Amazon founder Jeff Bezos, has criticized the President's administration.
Judge Patricia E. Campbell-Smith also released a sealed opinion accompanying the decision and ordered Amazon to post $42 million to cover damages in the event that the injunction was issued wrongfully.
The government also asked the court to reject Amazon's request to temporarily block work on the contract, arguing that such a pause would compromise national security and drain taxpayer money.
Amazon declined to comment.
In arguments making a case for Trump's deposition, Amazon sought to fit Trump's actions on the JEDI contract into a broader pattern of interference.
Pentagon spokesman Robert Carver said in a statement that the ruling unnecessarily delays implementation of the cloud contract and deprives "warfighters of a set of capabilities they urgently need".
Since it was awarded the JEDI contract, Microsoft has launched an aggressive staffing operation by recruiting employees from other defense contractors over the past few months. The contract is meant to give the military better access to data and technology from remote locations.
Amazon and Microsoft are industry leaders among cloud services providers. In July, Trump publicly stated that other companies told him the contract "wasn't competitively bid", and he said the administration would "take a very long look" at it. Amazon CEO Jeff Bezos has always been a target of Trump; the president calls the Bezos-owned Washington Post "fake news" whenever it publishes unfavorable stories about him.
It is not the first time a company has accused Mr Trump of improperly swaying the federal government's decision-making due to his objections to media coverage.
Telecoms operator AT&T made similar claims after the United States took action to block its takeover of Time-Warner, which owns CNN. The court blocked the firm from pursuing White House records, but ultimately approved that deal on other grounds.