Corkins said he was upset about the conservative group's stance against gay marriage.
Corkins had entered the building with the intention of shooting and killing as many employees of the organization as he could, prosecutors said. He was stopped by security guard Leonardo Johnson.
The Washington Post said Chief U.S. District Judge Richard W. Roberts called the shooting "horrific."
"The carnage you wanted did not happen only because an ordinary man showing extraordinary courage stopped you," Roberts said Thursday. "Killing human beings is not political activism. It is criminal behavior."
Federal prosecutors sought 45 years in prison for Corkins, comparing the Aug. 15, 2012, shooting to Monday's deadly rampage at the Washington Navy Yard.
"Mr. Corkins was this close to accomplishing that," Assistant U.S. Attorney T. Patrick Martin said. "He was no less determined than the Navy Yard gunman. He was no less prepared."
Corkins of Herndon, Va., pleaded guilty in February to charges of committing an act of terrorism while armed, assault with intent to kill while armed and interstate transportation of a firearm and ammunition.
The Justice Department said Corkins case marked the first time a defendant was charged with and convicted of committing an act of terrorism under a provision of Washington's Anti-Terrorism Act of 2002, which covers criminal actions committed with the intent to "intimidate or coerce a significant portion of the civilian population of the District of Columbia or the United States."
2014: The Year in Music [PHOTOS]