MADISON, Wis.—Police illegally videotaped a Wisconsin man having sex with his wife while she was in a coma in her nursing home room, an appeals court ruled Thursday.

David W. Johnson, 59, had an expectation to privacy when he visited his wife at Divine Savior Nursing Home in Portage, the District 4 Court of Appeals ruled. Therefore, police violated his Fourth Amendment rights against unreasonable searches when they installed a hidden video camera in the room, the court said.

"We are satisfied that Johnson's expectation of privacy while visiting his wife in her nursing home room is one that society would recognize as reasonable," a unanimous three-judge panel wrote.

The ruling means prosecutors cannot introduce the video tapes as evidence in their case against Johnson, who is charged with felony sexual assault for having intercourse with his wife without her consent at least three times in 2005.

Johnson's wife, Leah, was admitted to the nursing home after suffering a stroke, unable to speak or sit up. Nursing home staff members fed, cleaned and turned her, checking on her at least every two hours. Prosecutors say she was comatose.

Johnson's attorney Christopher Kelly said his client would visit the woman he married in 1988 every day, reading her the Bible and moving her arms and legs so her muscles wouldn't atrophy. The woman's sister, who is now her legal guardian, is upset that prosecutors brought charges against him, Kelly said.

"She believes her sister's husband was merely expressing his love for his wife and was trying everything he could to bring her back to consciousness," Kelly said.