Federal judge James Turk in 2003. (Seth Gitner/AP)

U.S. District Judge James Turk, who struck down a Virginia policy that allowed prisoners to look at Playboy but not read classical works of literature with explicit sexual passages, died July 6 at his home in Radford, Va. He was 91.

De Vilbiss Funeral Home in Radford confirmed the death but did not disclose the cause.

Mr. Turk was appointed to the U.S. District Court’s Western District of Virginia by President Richard M. Nixon in 1972 and became a senior judge in 2002. He never retired, continuing to work on notable cases throughout his final years.

“For 40 years, Judge Turk worked tirelessly to ensure that the federal judicial system in this district was fair and unbiased,” U.S. Attorney Timothy J. Heaphy said in a statement. “His tradition of shaking hands with defendants after their cases concluded was a perfect manifestation of his essential humanity and his ability to recognize the good in all people, regardless of circumstance.”

In the prison literature case, an inmate sued after he was denied access to the novels “Ulysses” by James Joyce and “Lady Chatterley’s Lover” by D.H. Lawrence. Prison officials had argued that those sexually explicit materials were “considered valuable currency and used in bartering” by inmates and that the possession of such items could lead to theft and fights.

The judge disagreed.

“Particularly with respect to ‘Ulysses’ it is impossible to even imagine prison inmates fighting for the chance to delve into the incredibly difficult to decipher novel, one metaphor-laden scene of which portrays exhibitionist behavior and masturbation,” Mr. Turk wrote in his 2010 ruling.

In another case, Mr. Turk dismissed a lawsuit in 2011 filed by a Virginia inmate who wanted the state to pay for a sex-change operation. A three-judge panel of the U.S. Court of Appeals for the 4th Circuit sent the case back to Mr. Turk in 2013, saying Ophelia De’Lonta’s case was entitled to a full hearing.

Mr. Turk ruled that the prison system was adequately treating her by providing counseling and hormone treatments and allowed her to dress as a woman in a men’s prison. She was paroled this year.

James Clinton Turk was born May 3, 1923, in Roanoke County. After Army service in World War II, he graduated in 1949 from Roanoke College and in 1952 from Washington and Lee University law school. He served in the Virginia Senate from 1959 to 1972.

He and his wife, Barbara, had five children.