NAMPA, Idaho—When a local nurse’s son was sent to the juvenile corrections center here at age 15, she was upset, but relieved that he would be away from drugs and gangs. The single mother said that the “night he went in, I felt bad, but I could sleep because he was safe.”

But within months, the head of security at the state juvenile corrections center in Nampa struck up a sexual relationship with the teenager, according to police reports. Julie McCormick admitted to having sex with him three times in 2012 while he was incarcerated,...