A "sea change" in the government's policy on challenging Parole Board decisions has been ruled "unlawful and irrational" by the High Court.
The judge said Mr Straw should adopt an even handed approach
The judge said the government must be "even handed" in deciding whether prisoners serving life sentences should be transferred to open prisons.
It had started accepting Parole Board recommendations opposing transfers, but blocking those in favour, he said.
And he quashed a ruling that killer Robert Hill should not be transferred.
Hill was a 21-year-old serving soldier when he killed a man in 1981, after the man threatened to inform the Army that they had committed homosexual acts together.
He is still in jail more than 14 years after becoming eligible for parole - judge Mr Justice Irwin said he had been left "languishing for years".
Being transferred to an open prison would bring him a step nearer to release on licence and the Parole Board recommended he be transferred.
But the judge said the secretary of state had adopted a "sea change" in policy, from March 2006, of a "near-automatic acceptance" of Parole Board decisions when they opposed transfers, but rejecting them when they were in favour.
He ruled: "If the secretary of state is to retain a discretion he must have an even-handed approach to the exercise of that discretion."
Justice Secretary Jack Straw either had to "determine to accept the board's advice, save in exceptional circumstances, whether that advice was for or against transfer".
Alternatively, he had to "look carefully with a questioning mind at every piece of advice, positive or negative, from the board."
The decision was based on views that Hill posed a continuing risk arising from his sexuality, but the judge said errors had gone uncorrected in the assessment.
The judge said: "That decision was irrational and will be quashed."
He ordered Mr Straw to reconsider Hill's application for transfer by 3 October.
Hill's solicitor Simon Creighton said the government's tougher stance on board recommendations followed critical reports last year on prisoners who were sent to open prisons, released on parole, then went on to kill.
"Unfortunately this change has led to the secretary of state developing and implementing an ill-thought-out policy which has now been declared unlawful," he said.
"This judgement will require him to carefully reconsider his policy in this area and come up with a fairer method of dealing with advice from the Parole Board."