A federal judge has ruled that John Yoo, a former Bush administration lawyer who wrote crucial memorandums justifying harsh interrogation techniques, will have to answer in court to accusations that his work led to a prisoner’s being tortured and deprived of his constitutional rights. The government had asked Judge Jeffrey S. White of Federal District Court in San Francisco to dismiss the case filed by Jose Padilla, an American citizen who spent more than three years in a military brig as an enemy combatant. Judge White denied most elements of Mr. Yoo’s motion and quoted a passage from the Federalist Papers that in times of war, nations, to be more safe, “at length become willing to run the risk of being less free.”