Arapahoe County District Judge Carlos Samour said police were justified in keeping attorneys from talking to Holmes for hours so they could safely defuse the bombs, the Denver Post reported Thursday.
"Given the precarious situation that confronted the officers, the need for answers to their questions outweighed the need to honor the defendant's invocation of the ... right to counsel," Samour wrote in a 126-page order.
Police said James Holmes booby-trapped his apartment with bombs before he allegedly began a shooting rampage during a midnight showing of a Batman movie in an Aurora movie theater in July 2012.
He is charged with killing 12 people and attempting to kill dozens of others, as well as rigging his apartment with explosives.
Holmes asked for an attorney a few minutes after detectives began questioning him but they prevented a public defender from talking to him. In a subsequent interview, they also barred an attorney hired by Holmes' family from meeting with him.
Samour ruled Holmes' statements were made voluntarily without coercion and allowing him to speak to attorneys could have endangered lives.
Without the information from Holmes, police said their best course of action was to detonate the bombs in the apartment and let the building burn down.